forked from MikeOrtiz/TouchImageView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (69 loc) · 2.97 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
language: android
branches:
only:
- master
sudo: true
jdk:
- oraclejdk8
env:
global:
# Where to run androidTests
- EMULATOR_API=22 # 24 has some issues, probably some overlayed window
- EMULATOR_ABI=armeabi-v7a
- EMULATOR_TAG=default
- PATH=$ANDROID_HOME:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH
android:
components:
- tools
- platform-tools
- build-tools-28.0.2
- android-28
- doc-27
install:
- echo $ANDROID_HOME # We assume this is correctly set when setting path
- sdkmanager --list || true # Look at the packages
- echo yes | sdkmanager "tools" # Ensure tools is updated
# - echo yes | sdkmanager "emulator" # Ensure emulator is present
# Install emulator
# - export EMULATOR="system-images;android-$EMULATOR_API;$EMULATOR_TAG;$EMULATOR_ABI"
# - echo yes | sdkmanager "platforms;android-$EMULATOR_API" # Install sdk
# - echo yes | sdkmanager "$EMULATOR" # Install system image
# - sdkmanager --list || true # Check everything is updated
# Create and start emulator
# - echo no | avdmanager create avd -n test -k "$EMULATOR" -f # Create emulator
# - which emulator # ensure we are using the right emulator (home/emulator/)
# - emulator -avd test -no-window -camera-back emulated -camera-front emulated -memory 2048 -writable-system & # Launch
# - adb wait-for-device # Wait for adb process
# - adb remount # Mount as writable
#before_script:
# - android-wait-for-emulator # Wait for emulator ready to interact
# - adb shell settings put global window_animation_scale 0 & # Disable animations
# - adb shell settings put global transition_animation_scale 0 & # Disable animations
# - adb shell settings put global animator_duration_scale 0 & # Disable animations
#
# # Would be great to use -v color to adb logcat but looks not supported on travis.
# - sleep 20 # Sleep 20 seconds just in case
# - adb shell input keyevent 82 & # Dispatch unlock event
# - adb logcat --help # See if this version supports color
# - adb logcat -c # Clear logcat
script:
- set -o pipefail
- ./gradlew clean build :app:check --profile --continue 2>&1 | tee build.log
- set +o pipefail
#- ./gradlew :app:connectedAndroidTest
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
#after_failure:
# #- cat /home/travis/build/hannesa2/DbPreferences/DBPrefs/build/reports/androidTests/connected/index.html
# - export MY_MOD="app"
# - export MY_LOG_DIR="$(pwd)/${MY_MOD}/build/reports/androidTests/connected/"
# - pwd && cd "${MY_LOG_DIR:-.}" && pwd && ls -al
# #- sudo apt-get install -qq lynx && lynx --dump index.html > myIndex.log
# #- lynx --dump com.android.builder.testing.ConnectedDevice.html > myConnectedDevice.log
# #- lynx --dump com.android.builder.testing.html > myTesting.log
# - for file in *.html; do echo "$file"; echo "====================="; cat "$file"; done || true