-
Notifications
You must be signed in to change notification settings - Fork 11
/
circle.yml
60 lines (52 loc) · 2.49 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
machine:
environment:
ADB_INSTALL_TIMEOUT: "10"
# GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter "tool"
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
override:
- ./gradlew dependencies
- ./gradlew androidDependencies
cache_directories: # relative to the build directory
- ~/.gradle #cache gradle dgradownloads between builds
- .gradle #cache gradle dgradownloads between builds
- /$ANDROID_HOME #cache gradle downloads between builds
test:
override:
# start the emulator
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
- ./gradlew lint -PdisablePreDex
# start assemble all outputs
- ./gradlew assemble -PdisablePreDex
# run unit tests
- ./gradlew test -PdisablePreDex
# build device tests
- ./gradlew assembleAndroidTest -PdisablePreDex
# wait for it to have booted
# - circle-android wait-for-boot
# unlock the emulator screen. This is to ensure the emulator screen wasn't on sleep mode.
# - sleep 30
# - 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
# run tests against the emulator.
# - ./gradlew connectedAndroidTest -PdisablePreDex -Pandroid.testInstrumentationRunnerArguments.size=small
# - ./gradlew connectedAndroidTest -PdisablePreDex -Pandroid.testInstrumentationRunnerArguments.size=medium
# - ./gradlew connectedAndroidTest -PdisablePreDex
# copy lint outputs to artifacts
# - cp -r app/build/reports/lint-* $CIRCLE_ARTIFACTS
# copy the build outputs to artifacts
# - cp -r app/build/outputs/apk/* $CIRCLE_ARTIFACTS
# copy the test results to the test results directory.
# - cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
post:
- mkdir -p $CIRCLE_TEST_REPORTS/./junit/
- mkdir -p $CIRCLE_TEST_REPORTS/android-junit/
- find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
- find . -type f -regex ".*/build/outputs/androidTest-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/android-junit/ \;
- find . -type f -regex ".*/build/outputs/apk/.*apk" -exec cp {} $CIRCLE_ARTIFACTS \;