-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
102 lines (91 loc) · 4.28 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
language: android
jdk:
- oraclejdk8
git:
depth: false
env:
matrix:
- ANDROID_API=29 EMULATOR_API=24
global:
- ANDROID_BUILD_TOOLS=29.0.2
- SONAR_TOKEN:2bc8ed788c4a8100772d7199796816142cdc561c
- secure: c79rhDiMPOiFlNheKDkPThfNk2EjrAYVOnzIMKGpAHLP2zgqJXtKJRj3FP5y43AOqMSvBeCjYgQRawmCqiWsIw8u2QD6wHtS74erDmgWkGncK8TQyRCZ7DsprJVzDQ99uA6vABxxMxJf3kUzTeLZC+ZN+s2VZLQKZZcJm5rB4IKBtrdDFYhTmgyrAo6sN/AD8MALh8HGIXO9yScdmLCkFztxnvQytzcNG7klKN/8tj31xGV2NdeEyT2CU5MeOBKp+o8LnHFlMBkfOO3uU+ABcSuPxC7IV7vIKlEj0s317Jw7mpJojjmlfSpkr6kpVGkhI991mXIfS5l03qo0vPP8cDhOKX0klCQokTZur6Qa2eNCv6PaL9HZ0xb2YtjhlXRS/+BOs8tQ/j7pRgH+YXpcm/xIVqzuBUE2V4YnDsXu6DPDrP+I/8egbfaPQ6UxZWKikXZ5BYxT267/rb1hndIBEaF7K3P/Yo3JHZQtiFQjuvQDWuNqR6Gf473UGU/vQtxtIsWAM/USGwzWI0JpXqYy79Sevw0tfSxSVUBJ+sSGQRWn1BbYXi3vjRp16bpdQoWTGsoAgZgCFX7tM4/4hXYPXUMFywGDls6VB0+xAxojJI3UbAU0a0tuq7p/rDqI6ceq1K6Sj3+7KlbSWS4vWK7G8IuRalVfKtLGXimIj2ZNQfQ=
android:
components:
- tools
- tools
- android-$EMULATOR_API
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_API
- extra-android-support
- extra-android-m2repository
- extra-google-m2repository
- sys-img-armeabi-v7a-android-$EMULATOR_API
- extra-google-google_play_services
- extra-google-m2repository
licenses:
- ".+"
before_script:
- echo "y" | android update sdk -a --no-ui --filter android-$EMULATOR_API
- echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-$EMULATOR_API
- android list targets | grep -E '^id:' | awk -F '"' '{$1=""; print $2}' # list all targets
- echo no | android create avd --force -n test -t android-$EMULATOR_API --abi armeabi-v7a
- emulator -avd test -no-skin -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- adb wait-for-device get-serialno
- cd ${TRAVIS_BUILD_DIR}
- chmod +x gradlew
- ./gradlew --version
- ./gradlew clean
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.m2
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
before_install:
# Unencrypt server account key for play publisher
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_3476a8f5fa31_key
-iv $encrypted_3476a8f5fa31_iv -in play-service-account-key.json.enc -out play-service-account-key.json
-d; fi
# Install SDK license so Android Gradle plugin can install deps.
- mkdir "$ANDROID_HOME/licenses" || true
- echo "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> "$ANDROID_HOME/licenses/android-sdk-license"
# Install the system image.
- yes | sdkmanager "platforms;android-$ANDROID_API"
script:
- |
./gradlew build assembleAndroidTest -PtestCoverageEnabled='true' --stacktrace
retval=$?
if [ $retval -ne 0 ]; then
echo "error on assembling, exit code: "$retval
exit $retval
fi
# See http://stackoverflow.com/questions/21294945/error-unable-to-find-instrumentation-info-for-componentinfo
# Instead of this (which doesn't give any output during tests execution):
- ./gradlew connectedCheck -PdisablePreDex --continue --stacktrace
# run:
#- |
# ./gradlew :app:installDebug :app:installDebugAndroidTest -PtestCoverageEnabled='true'
# retval=$?
# if [ $retval -ne 0 ]; then
# echo "error on install, exit code: "$retval
# exit $retval
# fi
deploy:
provider: releases
api_key:
secure: WK/kKL09FEBTCpQg5CDqfZorSybOL+TYMzylqKSgLUilAxByDK6tD0ZHSnNnoZjyX7wC8xhtA9jU/dChUHT4SGPoqDabn1EvfMlGuGym1iIzi76S9yo41llx5Ddjc1uTBsE8PhVWoqC889EeMoVkykOCoYytqJThw61Z9AEq1AWNX2ue/28YLfr0trZWDTZJHOFv61lW6zB0cSOtTCIa7I+//1OLL/pdwvFObj01p879ehctsvdBqPg00iFP6voJBCyu8v8rKEEJWRNT1qU39lb5xC/AR3CWNPXSfiIi7Er7bLJ1OhNXwDSugivaA/iIsBwooRt28reUbrdTkqk15HyU5xB7XsQHEAF6CjscS9wl0urtvNfWbLWV9R9oRAdC+q4OKcGbJ/TUrY5yRmm4V1WmC2V9utCM4iPjG7bSImdq7M7M7/d9YNAOFlLrKjC84PrPFR8bsZM8bO8BWxClyG6w8qpgstG/OcalNuAXsCeYZPSxr9iKlC9aIShH6VNgBQjgrpJ7aRqGD4cNekqfUQJ/7sHuZQJ7pw6rjdAsvkof87BGAjypdhGs5nZ7EysCCD3X7nWVP3TdcE2OfU1MCVSm+nugc40Yccreof2JuR0jgZWVN5evI+rn4wZvgUCVQYs5DJ+VI4qjiXA/tCmT3bKB2LhvfjwpgldxVyv0glc=
skip_cleanup: true
file: "./app/build/outputs/apk/release/app-release.apk"
on:
branch: master
tags: true
repo: shalzz/college-academics
after_deploy: "./gradlew publishRelease --stacktrace"