forked from sky-map-team/stardroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
108 lines (89 loc) · 3.88 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
# Setting java 1.8
language: android
jdk:
- oraclejdk8
sudo: required # disables container-based builds which have a maximum of 4GB of memory
# caching as advised by travis
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
env:
matrix:
# - EMULATOR_API_LEVEL=23 ANDROID_EMULATOR_IMAGE=sys-img-armeabi-v7a-android-23
- EMULATOR_API_LEVEL=24 ANDROID_EMULATOR_IMAGE=sys-img-arm64-v8a-android-24
# - EMULATOR_API_LEVEL=21 ANDROID_EMULATOR_IMAGE=sys-img-armeabi-v7a-android-21
# - EMULATOR_API_LEVEL=19 ANDROID_EMULATOR_IMAGE=sys-img-armeabi-v7a-android-19
global:
- ANDROID_API_LEVEL=27
- ANDROID_BUILD_TOOLS_VERSION=27.0.3
- ADB_INSTALL_TIMEOUT=20 # wait up to 20 minutes for adb to connect to emulator (2 minutes by default)
- ANDROID_ABI=arm64-v8a
android:
components:
# Base components
- tools # to get the new `repository-11.xml`
- tools # https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943)
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION # get the build tools version to build the project
# used sdk versions
- android-$ANDROID_API_LEVEL # get the android sdk version to build the project
- android-$EMULATOR_API_LEVEL # get the android sdk version for the emulator
# Get the latest version of additional components
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
- extra-google-google_play_services
# Specify the needed emulator
- $ANDROID_EMULATOR_IMAGE
licenses:
- 'android-sdk-license-.+'
- '.+'
# Emulator Management: Create, Start and Wait
before_install:
- echo $ANDROID_TARGET
- echo $ANDROID_ABI
- adb logcat > logcat.log &
install:
- sdkmanager --list || true # List all available targets, device definitions and AVDs.
# Update sdk tools to latest version and install/update components
- echo yes | sdkmanager "tools"
- echo yes | sdkmanager "platform-tools"
- echo yes | sdkmanager "build-tools;"$ANDROID_BUILD_TOOLS_VERSION
- echo yes | sdkmanager "platforms;android-"$ANDROID_API_LEVEL # Latest platform required by SDK tools
- echo yes | sdkmanager "extras;android;m2repository"
- echo yes | sdkmanager "extras;google;m2repository"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- echo yes | sdkmanager --update
- echo yes | sdkmanager --licenses
# Check components status
- sdkmanager --list || true
before_script:
# Create and start the emulator
- sdkmanager "system-images;android-"$EMULATOR_API_LEVEL";google_apis;$ANDROID_ABI"
- echo no | avdmanager -v create avd -f -n test -k "system-images;android-$EMULATOR_API_LEVEL;google_apis;$ANDROID_ABI"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
# Turn off animations
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
# Wake up
- adb shell input keyevent 82 &
- adb shell input keyevent 1 &
script:
- ./gradlew test # Local unit test
# Temporarily disable emulator based tests until the world figures out how to make them run again
# - ./gradlew connectedAndroidTest # Instrumented unit test
#- ./gradlew lint #maybe at some point
#- ./gradlew clean test build
after_script:
- echo $ANDROID_TARGET
- echo $ANDROID_ABI
- cat /home/travis/build/sky-map-team/stardroid/sdk-messaging/build/outputs/lint-results-debug.xml
- cat /home/travis/build/sky-map-team/stardroid/sdk/build/reports/androidTests/connected/index.html