-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (59 loc) · 2.18 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
language: android
jdk:
- oraclejdk8
env:
global:
- ADB_INSTALL_TIMEOUT=8
android:
components:
- tools
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-27.0.3
# The SDK version used to compile your project
- android-27
# For the emulator
- sys-img-armeabi-v7a-android-24
before_install:
# Bundle for fastlane
- bundle install
# Install SDK license so Android Gradle plugin can install deps.
- mkdir "$ANDROID_HOME/licenses" || true
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
# Install the rest of tools (e.g., avdmanager).
- yes | sdkmanager tools
# Install the system image.
- sdkmanager "system-images;android-24;default;armeabi-v7a"
# Create and start emulator for the script. Meant to race the install task.
- echo no | avdmanager create avd --force -n test -k "system-images;android-24;default;armeabi-v7a"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &
before_script:
# Emulator shit
# - 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 &
# Get secret files from environment variables
# gcloud service account for fastlane
- echo $GCLOUD_SERVICE_ACCOUNT_KEY | base64 --decode > service_account_key.json
# keystore for signing
- echo $KEYSTORE_BASE64 | base64 --decode > tmp-keystore.jks
# keystore copy for gradle
- cp tmp-keystore.jks app/
# fabric.properties
- echo apiKey=$(echo $FABRIC_API_TOKEN) > app/fabric.properties
- echo apiSecret=$(echo $FABRIC_BUILD_SECRET) >> app/fabric.properties
script:
# Output something every 10 minutes or Travis kills the job
- while sleep 60; do echo "=====[ $SECONDS seconds still running ]====="; done &
# Run tests always
- bundle exec fastlane test
# Deploy a beta release only for non pull request builds
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bundle exec fastlane beta; fi'
# Killing background sleep loop
- kill %1
branches:
only:
- master