forked from optimizely/android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
113 lines (103 loc) · 3.31 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
language: android
# you MUST mention trusty https://docs.travis-ci.com/user/languages/android/
dist: trusty
jdk: oraclejdk8
env:
# API 26+ supports "x86" (ANDROID_ABI=x86) emulators only, which are not supported yet in travis VMs
# so API 24 is the highest level we can run with emulator for now
# API-16 build fails in travis
- EMULATOR_API=19 ANDROID_ABI=armeabi-v7a ANDROID_API=29 ANDROID_BUILD_TOOLS=29.0.3
- EMULATOR_API=21 ANDROID_ABI=armeabi-v7a ANDROID_API=29 ANDROID_BUILD_TOOLS=29.0.3
- EMULATOR_API=24 ANDROID_ABI=armeabi-v7a ANDROID_API=29 ANDROID_BUILD_TOOLS=29.0.3
android:
components:
- tools
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_API
- android-$EMULATOR_API
# Google APIs
- addon-google_apis-google-$ANDROID_API
- addon-google_apis-google-$EMULATOR_API
# Google Play Services
- extra-google-google_play_services
# Support library
- extra-android-support
# Latest artifacts in local repository
- extra-google-m2repository
- extra-android-m2repository
# Emulators
- sys-img-$ANDROID_ABI-android-$EMULATOR_API
before_install:
#- touch $HOME/.android/repositories.cfg
before_script:
- echo $TRAVIS_BRANCH
- echo $TRAVIS_TAG
- echo no | android create avd --force -n test -t android-$EMULATOR_API --abi $ANDROID_ABI
- emulator -avd test -no-window &
- scripts/android-wait-for-emulator.sh
- adb shell input keyevent 82 &
script:
- ./gradlew cleanAllModules
- ./gradlew testAllModulesTravis
# Integration tests need to run first to reset the PR build status to pending
stages:
- name: 'Source Clear'
if: type = cron
- name: 'Lint markdown files'
- name: 'Integration tests'
- name: 'Test'
if: env(SNAPSHOT) IS NOT present
- name: 'Publish'
if: tag IS present
- name: 'Snapshot'
if: env(SNAPSHOT) = true and type = api
jobs:
include:
- stage: 'Lint markdown files'
os: linux
language: generic
install: gem install awesome_bot
before_script: skip
script:
- find . -type f -name '*.md' -exec awesome_bot {} \;
notifications:
email: false
- stage: 'Integration tests'
env:
- SDK=android
- BUILD_NUMBER=${TRAVIS_JOB_NUMBER/.}
- SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
- TESTAPP_BRANCH=master
cache: false
language: minimal
before_install: skip
install: skip
before_script:
- mkdir $HOME/travisci-tools && pushd $HOME/travisci-tools && git init && git pull https://$CI_USER_TOKEN@github.com/optimizely/travisci-tools.git && popd
script:
- $HOME/travisci-tools/trigger-script-with-status-update.sh
after_success: travis_terminate 0
- stage: 'Source Clear'
addons:
srcclr: true
before_install: skip
install: skip
before_script: skip
script: skip
after_script: skip
after_success: skip
- stage: 'Publish'
script:
- ./gradlew ship
after_script: skip
after_success: skip
- stage: 'Snapshot'
before_install:
# required to accept Android licenses before install
- yes | sdkmanager "platforms;android-29"
before_script: skip
script:
- TRAVIS_TAG=BB-SNAPSHOT ./gradlew ship
after_script: skip
after_success: skip