-
Notifications
You must be signed in to change notification settings - Fork 263
/
Copy pathcircle.yml
63 lines (52 loc) · 3.18 KB
/
circle.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
machine:
environment:
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-4.1/bin:$PATH"
TERM: "dumb"
ADB_INSTALL_TIMEOUT: "20"
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
_JAVA_OPTIONS: "-Xms512m -Xmx1024m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:ParallelGCThreads=2 -Djava.util.concurrent.ForkJoinPool.common.parallelism=2"
dependencies:
pre:
- wget "https://services.gradle.org/distributions/gradle-4.1-bin.zip"; unzip gradle-4.1-bin.zip
- if [ ! -e /usr/local/android-sdk-linux/build-tools/26.0.2 ]; then echo y | android update sdk --all --no-ui --filter "build-tools-26.0.2"; fi;
- if [ ! -e /usr/local/android-sdk-linux/platforms/android-25 ]; then echo y | android update sdk --all --no-ui --filter "android-25"; fi;
- if ! $(grep -q "Revision=47.0.0" /usr/local/android-sdk-linux/extras/android/m2repository/source.properties); then echo y | android update sdk --all --no-ui --filter "extra-android-m2repository"; fi;
- echo y | android update sdk --no-ui --all --filter tool,extra-google-google_play_services
- printf 'bintray.user=dummy_user\nbintray.apikey=dummy_api_key\nsdk.dir=/usr/local/android-sdk-linux' > local.properties
cache_directories:
- /usr/local/android-sdk-linux/build-tools/26.0.2
- /usr/local/android-sdk-linux/platforms/android-25
- /usr/local/android-sdk-linux/extras/android/m2repository
test:
override:
# run static analysis and unit tests with coverage
- ./gradlew checkWithCoverage :sample:lintDebug --stacktrace --no-daemon
# Create SD card (needed for screenshots)
- mksdcard -l sdcard 200M sdcard.img
# start the emulator
- emulator -avd circleci-android22 -sdcard sdcard.img -memory 2048 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
- sleep 30
# unlock the emulator screen
- adb shell input keyevent 82
# run instrumentation tests with coverage
- ./gradlew mergedJacocoTestReport --info --stacktrace --no-daemon -Ptest.integration.options.adbInstallOptions=-r
# Grab the screen from device at the end (useful if tests fail)
- adb shell screencap -p /sdcard/after_tests.png && adb pull /sdcard/after_tests.png sample/build/reports
- ./gradlew install --no-daemon --stacktrace
# upload merged code coverage report to Codecov.io
- bash <(curl -s https://codecov.io/bash) -f sample/build/reports/jacoco/mergedJacocoTestReport/mergedJacocoTestReport.xml
post:
# copy the test results to the test results directory
- mkdir -p $CIRCLE_TEST_REPORTS/unit
- mkdir -p $CIRCLE_TEST_REPORTS/instrumentation
- find . -type f -regex ".*/build/test-results/testDebugUnitTest/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/unit/ \;
- find . -type f -regex ".*/build/outputs/androidTest-results/connected/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/instrumentation/ \;
# copy the reports to artifacts directory
- mkdir -p $CIRCLE_ARTIFACTS/reports-library
- mkdir -p $CIRCLE_ARTIFACTS/reports-sample
- cp -r material-stepper/build/reports $CIRCLE_ARTIFACTS/reports-library
- cp -r sample/build/reports $CIRCLE_ARTIFACTS/reports-sample