Skip to content
This repository was archived by the owner on Mar 27, 2020. It is now read-only.

Commit f92db01

Browse files
committed
run travis-ci tests on emulator
This is my collection of hacks to make travis-ci more reliably run the test suite in an emulator. It also updates the SDK tools to the latest version to make sure things are working there.
1 parent 6cb94d5 commit f92db01

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

‎.travis.yml‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,44 @@
22
language: android
33
jdk: oraclejdk7
44

5+
env:
6+
global:
7+
# switch glibc to a memory conserving mode
8+
- MALLOC_ARENA_MAX=2
9+
# wait 5 minutes for adb to connect to emulator. Travis-ci cancels a
10+
# stalled build after 10 minutes, so this should be shorter than that so
11+
# there is time for the build to report the error.
12+
- ADB_INSTALL_TIMEOUT=5
13+
514
android:
615
components:
7-
- android-22
8-
- build-tools-22.0.1
9-
- extra-android-m2repository
16+
- tools
17+
- platform-tools
18+
- extra-android-m2repository
19+
- build-tools-22.0.1
20+
- android-22
21+
licenses:
22+
# only approve the Android software licenses, they match sources
23+
# the Google licenses mean proprietary software with binary blobs
24+
- 'android-sdk-preview-license-52d11cd2'
25+
- 'android-sdk-license-.+'
1026

1127
sudo: false
1228
notifications:
1329
email: false
1430

1531
script:
16-
- ./gradlew clean build
32+
# 'assemble' everything and run all checks that do not require a device/emulator
33+
# first with the wrapper, then with the system gradle
34+
- ./gradlew clean build
35+
- gradle clean build
36+
# start the emulator after the build to conserve memory
37+
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
38+
- emulator -avd test -no-skin -no-audio -no-window &
39+
- android-wait-for-emulator
40+
- adb shell input keyevent 82 &
41+
# now run the tests that require a device/emulator
42+
- gradle connectedCheck
43+
44+
after_failure:
45+
- find * -name lint-results.xml | xargs cat

0 commit comments

Comments
 (0)