This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
68 lines (55 loc) · 2.54 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
# General configuration
language: android
sudo: false
# Development dependencies
jdk: oraclejdk8
env:
global:
- API=21 # Android API level 25 by default
- TAG=default # Google APIs by default, alternatively use default
- ABI=armeabi-v7a # ARM ABI v7a by default
- ADB_INSTALL_TIMEOUT=8 # override 2 minute default
- QEMU_AUDIO_DRV=none # disable emulator audio to avoid warning
- GRADLE_USER_HOME="${TRAVIS_BUILD_DIR}/gradle" # change location for Gradle Wrapper and cache
- ANDROID_HOME=/usr/local/android-sdk-24.0.2 # depends on the cookbooks version used in the VM
- TOOLS=${ANDROID_HOME}/tools
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
android:
components:
- tools # Update preinstalled tools from revision 24.0.2 to 24.4.1
- build-tools-25.0.3
- platform-tools
- tools # Update tools from revision 24.4.1 to 25.2.5
before_install:
- export EMULATOR="system-images;android-${API};${TAG};${ABI}" # used to install/create emulator
- echo 'count=0' > /home/travis/.android/repositories.cfg # avoid warning
install:
- sdkmanager --list || true
- echo yes | sdkmanager "tools"
- echo yes | sdkmanager "platforms;android-25"
- echo yes | sdkmanager "platforms;android-${API}"
- 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 no | avdmanager create avd -n acib -k "$EMULATOR" -f --abi "$ABI" --tag "$TAG"
- emulator -avd acib -engine classic -no-window -camera-back none -camera-front none -verbose -qemu -m 512 &
- adb wait-for-device get-serialno
# Pipeline
before_script:
- android-wait-for-emulator
- 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 &
- sleep 30
- adb shell input keyevent 82 &
script: ./gradlew check connectedCheck
# Caching
before_cache:
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/modules-2/modules-2.lock # Avoid to repack it due locks
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/3.3/classAnalysis/classAnalysis.lock
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/3.3/jarSnapshots/jarSnapshots.lock
cache:
directories:
- ${TRAVIS_BUILD_DIR}/gradle/caches/
- ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/