-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
92 lines (80 loc) · 3.92 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
language: android
sudo: false
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=8
- ABI=armeabi-v7a
- 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:
#noneed - API=19
# API 20 doesn't have an emulator
#noneed - API=21
#noneed - API=22
#noneed - API=23 EMU_FLAVOR=google_apis
- API=24 #justneedthisone
#noneed- API=25 EMU_FLAVOR=google_apis
# API >= 26 don't have arm emulators, and Travis doesn't support x86
# matrix:
# fast_finish: true # We can report success without waiting for these
# # allow_failures:
#noneed - env: API=23 EMU_FLAVOR=google_apis # has permission errors
#noneed - env: API=25 EMU_FLAVOR=google_apis # has permission errors, emulator timeout
# jobs:
# include:
# # 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
android:
components:
# installing tools to start, then use `sdkmanager` below to get the rest
- tools
# - build-tools-27.0.3
# - android-28
# Additional components
# - extra-google-google_play_services
# - extra-google-m2repository
# - extra-android-m2repository
# - addon-google_apis-google-28
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.2" >/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 "platforms;android-27" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
- echo y | sdkmanager "ndk-bundle" >/dev/null #We need android ndk bundle to compile number 2 and 3
- 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 -avd test -engine classic -no-window $AUDIO -camera-back none -camera-front none -selinux permissive -qemu -m 1536 &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./Android/Level1/gradlew build
- ./Android/Level2/gradlew build
- ./Android/Level3/gradlew build
# Codacy integration, partials for all APIs, then an optional finalize
# after_success:
# - wget --progress=dot:giga -O ~/codacy-coverage-reporter-assembly-latest.jar https://oss.sonatype.org/service/local/repositories/releases/content/com/codacy/codacy-coverage-reporter/4.0.2/codacy-coverage-reporter-4.0.2-assembly.jar
# - if [[ ( "$API" != "NONE" ) ]]; then java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r AnkiDroid/build/reports/jacoco/report.xml --partial; fi
# - if [[ ( "$FINALIZE_COVERAGE" == "TRUE" ) ]]; then java -jar ~/codacy-coverage-reporter-assembly-latest.jar final; fi
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/