forked from osmdroid/osmdroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
147 lines (129 loc) · 7.15 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
language: android
jdk: openjdk8
android:
components:
- tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-26.0.3
# The SDK version used to compile your project
#
# "addon-google_apis-google-*" is only required when google apis are used
#
# Note: Don't add the platforms or addons required for the emulators here.
# Those are automatically downloaded in "before_install" on a per worker basis.
#
- android-26
#- addon-google_apis-google-23
# Additional components - currently not required
#- extra-google-m2repository #contains constraintlayout
#- extra-android-m2repository
#- extra-google-google_play_services
sudo: required
# fun fact, travis doesn't really support multiple AVDs running currently for a single build (tried it, build timed out constantly while starting up the AVDs)
# thus we're using a build matrix (which makes more sense anyhow)
env:
global:
#minutes (2 minutes by default), prevents CommandShellUnresponsiveExceptions
- ADB_INSTALL_TIMEOUT=14
# setup of emulators this will be tested on
#
# API: Desired API level of the emulator
# ANDROID_ABI: Currently either "armeabi" (only needed for API8) or "armeabi-v7a"
# ANDROID_TAG: Either "default" or "google_apis" if play services are used
#
# Below list was generated in June 2018. To get an up to date list of available options run "sdkmanager --list"
#
# Note: Currently (June 2018) there are no arm images for API > 25 provided by google.
# This is unlikely to change in the future due to the new emulator supporting
# (and requiring!) hardware acceleration for x86.
# Unfortunately Travis has no solution yet for providing KVM on the worker machines
# so running API25 and up emulators is not possible right now.
matrix:
#- API=10 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=10 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
#- API=14 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # emulator consistently times out
#- API=15 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # https://github.com/osmdroid/osmdroid/issues/1066
#- API=15 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
- API=16 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
- API=17 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=17 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
#- API=18 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=18 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
- API=19 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
- API=21 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default
#- API=21 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
#- API=22 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_DEXOPT: Package couldn't be installed in /data/app/org.osmdroid-2: scanPackageLI
#- API=22 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # currently no google apis needed
#- API=23 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # sdkmanager --list reports this to be available, but image is not found during build
#- API=23 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # Unable to install /home/travis/build/cbalster/osmdroid/OpenStreetMapViewer/build/outputs/apk/OpenStreetMapViewer-6.0.2-SNAPSHOT-debug.apk com.android.ddmlib.InstallException: Failed to establish session
#- API=24 ANDROID_ABI=armeabi-v7a ANDROID_TAG=default # "The command "adb shell ls /" failed and exited with 1 during." see line 108
#- API=24 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # emulator consistently times out
#- API=25 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis # no addons available, so can't be used
before_install:
# create and start emulators; automatically downloads required platform and - if necessary - the google api addons
- echo yes | sdkmanager "tools" "platforms;android-$API"
- if [ $ANDROID_TAG == "google_apis" ]; then echo yes | sdkmanager "add-ons;addon-google_apis-google-$API"; fi
- echo yes | sdkmanager "system-images;android-$API;$ANDROID_TAG;$ANDROID_ABI"
- avdmanager list
- echo avdmanager create avd -f -n test-api$API -k "system-images;android-$API;$ANDROID_TAG;$ANDROID_ABI" -c 200M
- echo no | avdmanager create avd -f -n test-api$API -k "system-images;android-$API;$ANDROID_TAG;$ANDROID_ABI" -c 200M
- $ANDROID_HOME/emulator/emulator -memory 1536 -avd test-api$API -no-window -no-audio&
install:
# run build while emulator is starting up
- ./gradlew -version
- ./gradlew clean assemble assembleAndroidTest
# mvn sdk deploy
before_script:
# android list
# TEMPORARY comment out of the maven build since it's broken at the moment
#- mkdir temp
#- cd temp
#- git clone https://github.com/simpligility/maven-android-sdk-deployer
#- cd maven-android-sdk-deployer
#- mvn clean install -fn -B -U
#- cd ..
#- cd ..
- android-wait-for-emulator
- adb shell input keyevent 82 &
# output date/time set on emulator for diagnostics
- adb shell date
#setup for maps forge adapter
#- wget http://download.mapsforge.org/maps/world/world.map
- adb shell ls /
- adb shell ls /sdcard/
- adb shell ls /sdcard/osmdroid
- adb root
- adb shell mount -o rw,remount rootfs /
- adb shell chmod 777 /mnt/sdcard
- adb shell mkdir /sdcard/osmdroid/
- adb push world.map /sdcard/osmdroid/world.map
- adb push testzoom4.sqlite /sdcard/osmdroid/testzoom4.sqlite
- adb push testzoom4.zip /sdcard/osmdroid/testzoom4.zip
- adb push testzoom4.gemf /sdcard/osmdroid/testzoom4.gemf
#maybe one day it will be added to the repo- adb push ERDC_Whitehorse_GeoPackage.gpkg /sdcard/osmdroid/ERDC_Whitehorse_GeoPackage.gpkg
#- adb push resources/usgsbase.gemf /sdcard/osmdroid/usgsbase.gemf
#- adb push resources/usgstopo.sqlite /sdcard/osmdroid/usgstopo.sqlite
#- adb push resources/usgssat.zip /sdcard/osmdroid/usgssat.zip
#build
script:
#build using maven with integration tests
#we build 3 times due to issues with the maven-android-plugin. root cause is unknown but seems to be related to how artifacts are resolved for android projects
#in case you're wondering -fn means fail never, which loosely means, if the build fails, the exit code is always 0, which is basically all CI engines look for.
#the dist profile adds the zip and tar outputs of all javadocs and source jars
#- ./travis.sh
#- mvn install -fn -B -U -Pdist
#- mvn install -Pdist
#- mvn android:undeploy
#run tests
- travis_wait 60 ./gradlew check connectedCheck
# fun fact, maven runs android tests concurrently for all connected devices, gradle does not
# since we're using build matrix, each build target compiles the source, fires up it's specific vm, runs the tests, then exits.
# --stacktrace
after_failure:
# run this on failure
- adb pull /sdcard/osmdroid/crash.log
- cat crash.log
# dumps the log then exits
- adb logcat -d