-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path.travis.yml
70 lines (59 loc) · 2.73 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
if: (tag IS present) OR (type = pull_request)
language: android
dist: bionic
jdk: openjdk17
env:
global:
- JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2
# If you want to run snapshot tests change value to 'true'. Build time will be increased by 6 minutes.
- RUN_SNAPSHOT_TESTS=false
- ROBOLECTRIC_SDK8_URL=https://repo1.maven.org/maven2/org/robolectric/android-all/8.0.0_r4-robolectric-r1/android-all-8.0.0_r4-robolectric-r1
- ROBOLECTRIC_SDK8_DIR=$HOME/.m2/repository/org/robolectric/android-all/8.0.0_r4-robolectric-r1
- ROBOLECTRIC_SDK8_FILE=${ROBOLECTRIC_SDK8_DIR}/android-all-8.0.0_r4-robolectric-r1
android:
components:
- tools
- platform-tools
- tools
- build-tools-34.0.0
- android-34
- extras;android;m2repository
# Uncomment for snapshot tests
#- sys-img-x86-android-22
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
before_install:
# Library for image manipulation in snapshot tests
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then python -m pip install Tools/Pillow-6.2.2-cp27-cp27mu-manylinux1_x86_64.whl --user; fi;
before_script:
# Run emulator
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then echo no | android create avd --force -n test -t android-22 --abi x86 -c 100M; fi;
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 & fi;
script:
# make sure Robolectric dependency is presented
- mkdir -p ${ROBOLECTRIC_SDK8_DIR}
- curl ${ROBOLECTRIC_SDK8_URL}.jar --output ${ROBOLECTRIC_SDK8_FILE}.jar
- curl ${ROBOLECTRIC_SDK8_URL}.jar.sha1 --output ${ROBOLECTRIC_SDK8_FILE}.jar.sha1
- curl ${ROBOLECTRIC_SDK8_URL}.pom --output ${ROBOLECTRIC_SDK8_FILE}.pom
- curl ${ROBOLECTRIC_SDK8_URL}.pom.sha1 --output ${ROBOLECTRIC_SDK8_FILE}.pom.sha1
- ls -la ${ROBOLECTRIC_SDK8_DIR}
- ./gradlew assembleRelease testReleaseUnitTest
# wait emulator to come alive and start snapshot tests
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then android-wait-for-emulator; fi;
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then adb shell input keyevent 82 & fi;
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then ./gradlew verifyDebugAndroidTestScreenshotTest; fi;
before_deploy:
- ./Tools/verifyTag.sh
- ./gradlew assembleRelease generatePomFileForAarPublication
after_deploy:
- ./Tools/triggerRondo.sh
- version=`cat sdk-version.txt`; if [[ $version != *"beta"* ]]; then ./Tools/triggerRN.sh; fi; # trigger ReactNative if not beta release
deploy:
- provider: script
skip_cleanup: true
script: ./gradlew artifactoryPublish publishAarPublicationToSonatypeRepository
dpl_version: 1.10.16
on:
tags: true