forked from getodk/collect
/
config.yml
163 lines (146 loc) 路 5.7 KB
/
config.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# This config and the the Gradle flags/opts are based on: https://circleci.com/docs/2.0/language-android/
# and https://support.circleci.com/hc/en-us/articles/360021812453
version: 2
references:
workspace: &workspace
~/work
android_config: &android_config
working_directory: *workspace
docker:
- image: circleci/android:api-30
jobs:
check_quality:
<<: *android_config
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1024m" -Dkotlin.compiler.execution.strategy=in-process'
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Download dependencies
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Run code quality checks
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 checkCode
- store_artifacts:
path: collect_app/build/reports
destination: reports
test_modules:
<<: *android_config
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1024m" -Dkotlin.compiler.execution.strategy=in-process'
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Download dependencies
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Run async unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 async:testDebug
- run:
name: Run strings unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 strings:testDebug
- run:
name: Run material unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 material:testDebug
- run:
name: Run audioclips unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 audioclips:testDebug
- run:
name: Run audiorecorder unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 audiorecorder:testDebug
- store_artifacts:
path: collect_app/build/reports
destination: reports
- store_test_results:
path: collect_app/build/test-results
test_app:
<<: *android_config
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1024m" -Dkotlin.compiler.execution.strategy=in-process'
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Download dependencies
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Run app unit tests
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 collect_app:testDebug
- store_artifacts:
path: collect_app/build/reports
destination: reports
- store_test_results:
path: collect_app/build/test-results
test_instrumented:
<<: *android_config
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1024m" -Dkotlin.compiler.execution.strategy=in-process'
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Download dependencies
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "collect_app/build.gradle" }}
- run:
name: Assemble test build
command: ./gradlew -PdisablePreDex --no-daemon --max-workers=2 assembleDebug assembleDebugAndroidTest
- run:
name: Authorize gcloud
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "getodk" ]]; then \
gcloud config set project api-project-322300403941
echo $GCLOUD_SERVICE_KEY | base64 --decode > client-secret.json
gcloud auth activate-service-account --key-file client-secret.json
fi
- run:
name: Run integration tests
command: |
if [[ "$CIRCLE_PROJECT_USERNAME" == "getodk" ]]; then \
echo "y" | gcloud beta firebase test android run \
--type instrumentation \
--num-uniform-shards=50 \
--app collect_app/build/outputs/apk/debug/*.apk \
--test collect_app/build/outputs/apk/androidTest/debug/*.apk \
--device model=Pixel2,version=28,locale=en,orientation=portrait \
--results-bucket opendatakit-collect-test-results \
--environment-variables coverage=true,coverageFile=/sdcard/coverage.ec \
--directories-to-pull /sdcard --timeout 20m
fi
no_output_timeout: 60m
workflows:
version: 2
workflow:
jobs:
- check_quality
- test_modules
- test_app
- test_instrumented:
requires:
- check_quality
- test_modules
- test_app
filters:
branches:
only: master