forked from OneBusAway/onebusaway-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
93 lines (84 loc) · 4.02 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
language: android
dist: trusty
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=8
- ABI=x86_64
- EMU_FLAVOR=default # use google_apis flavor if no default flavor emulator
# PATH order is incredibly important. e.g. the 'emulator' script exists in more than one place!
- ANDROID_HOME=/usr/local/android-sdk
- TOOLS=${ANDROID_HOME}/tools
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
matrix:
#- API=15 # only runs locally. Create+Start once from AndroidStudio to init sdcard. Then only from command-line w/-engine classic
#- API=16 ABI=armeabi-v7a AUDIO=-no-audio # Fails with "com.android.builder.testing.ConnectedDevice > No tests found."
#- API=17 ABI=armeabi-v7a # Fails with "com.android.builder.testing.ConnectedDevice > No tests found."
#- API=18 ABI=armeabi-v7a # Fails with "com.android.builder.testing.ConnectedDevice > No tests found."
#- API=19 ABI=armeabi-v7a # Fails: kernel/emulator mismatch, and emulator-29+ doesn't support "-engine classic" to fix
# API 20 was Android Wear only
- API=21
- API=22
- API=23
- API=24
- API=25
#- API=26 ABI=x86_64 # Fails with unrecognized tests? orchestrator change or something?
#- API=27 # Same failure as below for API28, but less frequently
#- API=28 # Fails on adb 2 second getprop timeout and get API getprop takes 2.2s, so emulator boots but adb won't install on unknown API
#- API=Q # Fails at some point on emulator startup or detecting startup complete
jobs:
fast_finish: true # We can report success without waiting for jobs that we
# allow / expect to fail.
include:
- jdk: oraclejdk11
env: API=24
# The test stage is implicit, we only need to define a post-test stage for codacy finalization
- stage: finalize_coverage
env: FINALIZE_COVERAGE=TRUE API=NONE
install: skip
script: echo finalize codacy coverage uploads
allow_failures:
- jdk: oraclejdk11
# API=28/Q are probably fixable but we don't need allow_failures to be on
# in master to work through them.
#- env: API=28
#- env: API=Q
android:
components:
# installing tools to start, then use `sdkmanager` below to get the rest
- tools
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
# Emulator Management: Create, Start and Wait
install:
- echo 'count=0' > /home/travis/.android/repositories.cfg # Avoid harmless sdkmanager warning
- echo y | sdkmanager "platform-tools" >/dev/null
- echo y | sdkmanager "tools" >/dev/null # A second time per Travis docs, gets latest versions
- echo y | sdkmanager "build-tools;28.0.3" >/dev/null # Implicit gradle dependency - gradle drives changes
- echo y | sdkmanager "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
- echo y | sdkmanager "platforms;android-28" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
- echo y | sdkmanager --channel=4 "emulator" >/dev/null # Use canary channel to get emulator 29.x for x86_64 image support
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
- echo y | sdkmanager "system-images;android-$API;$EMU_FLAVOR;$ABI" >/dev/null # install our emulator
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
- emulator -verbose -avd test -no-accel -no-snapshot -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 2048 &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew assembleObaGoogleDebug assembleObaAmazonDebug assembleYrtGoogleDebug
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
notifications:
webhooks:
# Integration with Gitter (https://gitter.im/OneBusAway/onebusaway-android)
urls:
- https://webhooks.gitter.im/e/a579a4e7a21ff6ee51a1
on_success: change
on_failure: always