forked from getodk/collect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
67 lines (55 loc) · 3.76 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
machine:
environment:
# Disable emulator audio
QEMU_AUDIO_DRV: none
# Set memory limits for the JVM
# https://circleci.com/docs/oom/#setting-memory-limits-for-the-jvm
_JAVA_OPTIONS: "-Xms256m -Xmx1280m -XX:MaxPermSize=350m"
# 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="-Xmx1536m -XX:MaxPermSize=512m -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=58.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
cache_directories:
- /usr/local/android-sdk-linux/tools
- /usr/local/android-sdk-linux/platform-tools
- /usr/local/android-sdk-linux/build-tools/25.0.2
- /usr/local/android-sdk-linux/platforms/android-25
- /usr/local/android-sdk-linux/extras/android/m2repository
- /usr/local/android-sdk-linux/extras/google/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
# SD card needed for circleci-android22 image
# https://circleci.com/docs/1.0/android/
- mksdcard -l e 128M sdcard.img
- emulator -memory 256 -avd circleci-android22 -sdcard sdcard.img -no-window:
background: true
parallel: true
- circle-android wait-for-boot
- ./gradlew connectedCheck -Pandroid.useDexArchive=false
post:
- cp -r collect_app/build/reports/checkstyle $CIRCLE_TEST_REPORTS
- mkdir -p $CIRCLE_TEST_REPORTS/lint
- find . -type f -regex ".*/collect_app/build/reports/lint-results-*.*" -exec cp {} $CIRCLE_TEST_REPORTS/lint/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/findbugs
- find . -type f -regex ".*/collect_app/build/reports/findbugs/findbugs.*" -exec cp {} $CIRCLE_TEST_REPORTS/findbugs/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/pmd
- find . -type f -regex ".*/collect_app/build/reports/pmd/pmd*.*" -exec cp {} $CIRCLE_TEST_REPORTS/pmd/ \;
- mkdir -p $CIRCLE_TEST_REPORTS/tests
- find . -type f -regex ".*/collect_app/build/reports/coverage/debug/report*.*" -exec cp {} $CIRCLE_TEST_REPORTS/tests/ \;
- bash <(curl -s https://codecov.io/bash)