forked from getodk/counter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
69 lines (58 loc) · 4.4 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
64
65
66
67
68
69
machine:
environment:
# Set memory limits for the JVM
# https://circleci.com/docs/oom/#setting-memory-limits-for-the-jvm
_JAVA_OPTIONS: "-Xms512m -Xmx2048m"
# Out of memory errors in Android builds
# https://circleci.com/docs/oom/#out-of-memory-errors-in-android-builds
# https://docs.gradle.org/current/userguide/build_environment.html
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2560M -XX:+HeapDumpOnOutOfMemoryError"'
dependencies:
pre:
# Cache Android SDK to avoid unnecessary downloads
# https://discuss.circleci.com/t/android-sdk-support-library-24/5247/5
- if ! $(grep -q "Revision=25.2.5" /usr/local/android-sdk-linux/tools/source.properties); then echo y | android update sdk --no-ui --all --filter "tools"; fi
- if ! $(grep -q "Revision=26" /usr/local/android-sdk-linux/platform-tools/source.properties); then echo y | android update sdk --no-ui --all --filter "platform-tools"; fi
- if [ ! -e /usr/local/android-sdk-linux/build-tools/26.0.1 ]; then echo y | android update sdk --no-ui --all --filter "build-tools-26.0.1"; fi
- if [ ! -e /usr/local/android-sdk-linux/platforms/android-25 ]; then echo y | android update sdk --no-ui --all --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 --no-ui --all --filter "extra-android-m2repository"; fi
- if ! $(grep -q "Revision=57.0.0" /usr/local/android-sdk-linux/extras/google/m2repository/source.properties); then echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"; fi
- if [ ! -e /usr/local/android-sdk-linux/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2 ]; then echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"; fi
cache_directories:
- /usr/local/android-sdk-linux/tools
- /usr/local/android-sdk-linux/platform-tools
- /usr/local/android-sdk-linux/build-tools/26.0.1
- /usr/local/android-sdk-linux/platforms/android-25
- /usr/local/android-sdk-linux/extras/android/m2repository
- /usr/local/android-sdk-linux/extras/google/m2repository
- /usr/local/android-sdk-linux/extras/m2repository
test:
override:
# Disable incremental dexing on all gradle commands to speed up clean builds
# https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/2-5-alpha-gradle-plugin/trying-gradle-plugin-2-5
- ./gradlew pmd -Pandroid.useDexArchive=false
- ./gradlew findbugs -Pandroid.useDexArchive=false
- ./gradlew lint -Pandroid.useDexArchive=false
- ./gradlew checkstyle -Pandroid.useDexArchive=false
- ./gradlew testDebugUnitTest -Pandroid.useDexArchive=false
# Instrumented tests take time, so only run them on master
# SD card needed for circleci-android22 image
# https://circleci.com/docs/1.0/android/
- if [ $CIRCLE_BRANCH = 'master' ]; then mksdcard -l e 128M sdcard.img; fi
- if [ $CIRCLE_BRANCH = 'master' ]; then emulator -avd circleci-android22 -sdcard sdcard.img -no-window; fi:
background: true
parallel: true
- if [ $CIRCLE_BRANCH = 'master' ]; then circle-android wait-for-boot; fi
- if [ $CIRCLE_BRANCH = 'master' ]; then ./gradlew connectedCheck -Pandroid.useDexArchive=false; fi
post:
- cp -r app/build/reports/checkstyle $CIRCLE_TEST_REPORTS
- mkdir -p $CIRCLE_TEST_REPORTS/lint
- find . -type f -regex ".*/app/build/reports/lint-results-*.*" -exec cp {} $CIRCLE_TEST_REPORTS/lint/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/findbugs
- find . -type f -regex ".*/app/build/reports/findbugs/findbugs.*" -exec cp {} $CIRCLE_TEST_REPORTS/findbugs/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/pmd
- find . -type f -regex ".*/app/build/reports/pmd/pmd*.*" -exec cp {} $CIRCLE_TEST_REPORTS/pmd/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/tests
- find . -type f -regex ".*/app/build/test-results/.*.xml" -exec cp {} $CIRCLE_TEST_REPORTS/tests/ \;
- if [ $CIRCLE_BRANCH = 'master' ]; then cp -r app/build/outputs/apk $CIRCLE_ARTIFACTS; fi
- if [ $CIRCLE_BRANCH = 'master' ]; then cp -r app/build/reports/androidTests/connected $CIRCLE_TEST_REPORTS/androidTests; fi