This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
forked from optimizely/android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
79 lines (77 loc) · 2.54 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
language: android
# you MUST mention trusty https://docs.travis-ci.com/user/languages/android/
dist: trusty
env:
global:
# These parameters should match the parameters for build tools and sdk versions in the gradle file
- ANDROID_BUILD_TOOLS=28.0.3 # should match gradle
- ADB_INSTALL_TIMEOUT=5 # minutes
- ANDROID_API=28 # api is same as gradle file
matrix:
- EMULATOR_API=21
- EMULATOR_API=22
android:
components:
- tools
- platform-tools-$ANDROID_BUILD_TOOLS
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_API
- android-$EMULATOR_API
- extra-google-m2repository
- extra-android-m2repository # for design library
- addon-google_apis-google-19 # google play services
- sys-img-armeabi-v7a-addon-google_apis-google-$ANDROID_API
- sys-img-armeabi-v7a-addon-google_apis-google-$EMULATOR_API
- sys-img-armeabi-v7a-android-$EMULATOR_API
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_install:
#- yes | sdkmanager "platforms;android-$ANDROID_API"
before_script:
- echo $TRAVIS_BRANCH
- echo $TRAVIS_TAG
- echo no | android create avd --force -n test -t android-$EMULATOR_API --abi armeabi-v7a
- emulator -avd test -no-audio -no-window &
- scripts/android-wait-for-emulator.sh
- adb shell input keyevent 82 &
addons:
srcclr: true
script:
- ./gradlew cleanAllModules
- ./gradlew testAllModulesTravis
- if [[ -n $TRAVIS_TAG ]]; then ./gradlew ship; fi
# Integration tests need to run first to reset the PR build status to pending
stages:
- 'Integration tests'
- 'Benchmarking tests'
- 'Test'
jobs:
include:
- &integrationtest
stage: 'Integration tests'
env:
- SDK=android
- BUILD_NUMBER=${TRAVIS_JOB_NUMBER/.}
- SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
cache: false
language: minimal
before_install: skip
install: skip
before_script:
- mkdir $HOME/travisci-tools && pushd $HOME/travisci-tools && git init && git pull https://[email protected]/optimizely/travisci-tools.git && popd
script:
- $HOME/travisci-tools/trigger-script-with-status-update.sh
after_success: travis_terminate 0
- <<: *integrationtest
stage: 'Benchmarking tests'
env: SDK=android FULLSTACK_TEST_REPO=Benchmarking BUILD_NUMBER=${TRAVIS_JOB_NUMBER/.} SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH