forked from DreierF/MyTargets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
103 lines (100 loc) · 5.03 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
103
language: android
dist: trusty
jdk:
- openjdk8
env:
global:
# - ADB_INSTALL_TIMEOUT=8
- ANDROID_API_LEVEL=28
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
# - ANDROID_ABI=armeabi-v7a
# - EMULATOR_API_LEVEL=21
- PWD=`pwd`
android:
components:
- tools
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
# - android-$EMULATOR_API_LEVEL
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
# - sys-img-armeabi-v7a-android-$EMULATOR_API_LEVEL
# licenses:
# - 'android-sdk-preview-license-52d11cd2'
# - 'android-sdk-license-.+'
# - 'google-gdk-license-.+'
before_install:
- openssl aes-256-cbc -K $encrypted_143bf53fc355_key -iv $encrypted_143bf53fc355_iv -in services.tar.enc -out services.tar -d
- tar xvf services.tar
- wget https://raw.githubusercontent.com/JakeWharton/pidcat/master/pidcat.py
- touch ~/.android/repositories.cfg
- yes | sdkmanager "platforms;android-28"
- yes | sdkmanager "build-tools;28.0.3"
- mkdir -p "$ANDROID_HOME/licenses"
- echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n24333f8a63b6825ea9c5514f83c2829b004d1fee%" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
- yes | sdkmanager --update
- yes | sdkmanager --licenses
install:
# Converts the shallow clone to a full clone
# This is necessary in order to determine the current app version code
- git fetch --unshallow --tags
before_script:
# - echo no | android create avd -f -n test -t "android-"$EMULATOR_API_LEVEL --abi $ANDROID_ABI -s WVGA800 -c 128M
# - emulator -avd test -no-audio -no-window &
- ./gradlew clean
script:
- echo -e '\033[0;33mBuilding...\033[0m' && echo -en 'travis_fold:start:script.build\\r'
- ./gradlew assembleRegularRelease -PdisablePreDex
- echo -en 'travis_fold:end:script.build\\r'
- echo -e '\033[0;33mUnit tests...\033[0m' && echo -en 'travis_fold:start:script.unittest\\r'
- ./gradlew testRelease -PdisablePreDex
- echo -en 'travis_fold:end:script.unittest\\r'
# - echo -e '\033[0;33mUI tests...\033[0m' && echo -en 'travis_fold:start:script.uitest\\r'
# - ./gradlew :app:assembleDevDebug :app:assembleDevDebugAndroidTest -PdisablePreDex
# - 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
# - adb shell input keyevent 82 &
# - adb logcat -c
# - travis_wait 40 ./gradlew createDevDebugCoverageReport -PdisablePreDex
# - echo -en 'travis_fold:end:script.uitest\\r'
after_success:
- |
if [[ "$TRAVIS_TAG" ]]; then
./gradlew bootstrapRegularReleasePlayResources publishRegularRelease
./gradlew -PFirebaseServiceAccountFilePath=$PWD/firebase-crashreporting.json :app:firebaseUploadRegularReleaseProguardMapping
./dropbox_uploader.sh upload app/build/outputs/apk/regular/release/app-regular-release.apk /Release/$TRAVIS_TAG/MyTargets.apk
./dropbox_uploader.sh upload app/build/outputs/mapping/regular/release/mapping.txt /Release/$TRAVIS_TAG/mapping.txt
fi
# - bash <(curl -s https://codecov.io/bash)
# - ./gradlew sendCoverageToCodacy -PdisablePreDex
after_failure:
# - adb logcat -d 2>&1 | python pidcat.py de.dreier.mytargets.debug &> logcat.log
# - ./dropbox_uploader.sh upload logcat.log /Reports/$TRAVIS_JOB_NUMBER.logcat
# - >
# cd app/build/reports/androidTests/connected/flavors/DEV/ &&
# ( adb pull /sdcard/screenshots/ || true ) &&
# mv ../../../../../../../logcat.log logcat.log &&
# zip -r reports.zip . &&
# cd ../../../../../../.. &&
# ./dropbox_uploader.sh upload app/build/reports/androidTests/connected/flavors/DEV/reports.zip /Reports/$TRAVIS_JOB_NUMBER.zip
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: Iz8i8L5YlrCq7KdkKNenb4wKQR0TrtR3eoJ/e0U/jsZb3CGqNru0HtatJTCvggR/Md5FGCmk6LD2Wl9usbIv6rn2F5T4GSSYxRtYZ4124zt+GyEU3jAlgJt72AJEIAVFjTtWAcM9mUc8QME/iOeDbbZUt6LV+IP1UbY472K6+R4sd/ChRq4tRAlK/kMjGgoBjXH9iV+RZkjrGvHwHc8UsOUPnl/4PhqLBda+SYDsjZWOQCnNUv8G2dTlHnbgF6eIKjHR4NpAIHYEqkTE5YV7aWjKQy4UGFZStkqhiaMpfntJ+KJWr/fOaKwwxIq3JuBUC0fbyj81q5Yf/zvGOmkeejU3K28+sWfYKD016JbWh58GuOY5OCXRd8SmnMG3kndhAZ3GmgmJClvK+cW8wtF1xOmnoSHaeB48y2VIDrZ1yZm5aZ/dgUUTxaKzVfZpqo1JL4PWm6l1vU4+tp89ds3oynpVowkZxjgH5kr9f10fe+oOtTY6lrUIvZbDIL74/EEV2YFMe2ittjRlBm2En3cOvpisEqYGZwm4yFrZ45fhSQui12NiUrXHBfrAbX/qT+VSH0OCmYxm6muPz/XJCXIcl1zTwj6kiFF0Dw3paTsYbkaDQRXHvdJIr8PBDcSZSrP9kyyQjaog0HtS7OqXbugw6qDaya9+zkHVy4LWVDOpEYM=
file: app/build/outputs/apk/regular/release/app-regular-release.apk
on:
tags: true
repo: DreierF/MyTargets
notifications:
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify
email: false