forked from eidottermihi/rpicheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
76 lines (63 loc) · 2.94 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
language: android
sudo: required
jdk: oraclejdk8
services:
- docker
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/
android:
components:
- tools
- build-tools-27.0.3
- platform-tools
- tools
env:
global:
- API=21 # Android API level 21 by default
- TAG=default # Google APIs by default, alternatively use default
- ABI=armeabi-v7a # ARM ABI v7a by 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 # Depends on the cookbooks version used in the VM
- TOOLS=${ANDROID_HOME}/tools # PATH order matters, exists more than one emulator script
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
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
- docker build -t rpicheck/test-sshd ./ssh/src/test/resources/
- docker run -d -p 127.0.0.1:2222:22 rpicheck/test-sshd
install:
# List and delete unnecessary components to free space
- sdkmanager --list || true
# Update sdk tools to latest version and install/update components
- echo yes | sdkmanager "tools" >/dev/null
- echo yes | sdkmanager "platforms;android-27" >/dev/null # Latest platform required by SDK tools
- echo yes | sdkmanager "platforms;android-${API}" >/dev/null # Android platform required by emulator
- echo yes | sdkmanager "extras;android;m2repository" >/dev/null
- echo yes | sdkmanager "extras;google;m2repository" >/dev/null
- echo yes | sdkmanager "emulator" >/dev/null # latest emulator
- echo yes | sdkmanager "$EMULATOR" >/dev/null # Install emulator system image
# Check components status
- sdkmanager --list || true
- echo $PATH
before_script:
# Create and start emulator
- echo no | avdmanager create avd -n acib -k "$EMULATOR" -f --abi "$ABI" --tag "$TAG"
- emulator -avd acib -no-window -camera-back none -camera-front none -engine classic &
# Wait for emulator fully-booted and disable animations
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
# Run all device checks
- cd ${TRAVIS_BUILD_DIR}/${DIR} && ./gradlew build connectedCheck -PdisablePreDex
after_script:
# Show tests and lint results
- cat ${TRAVIS_BUILD_DIR}/${DIR}/*/build/outputs/androidTest-results/connected/*
- cat ${TRAVIS_BUILD_DIR}/${DIR}/*/build/reports/lint-results.xml