Newer
Older
version: 2.1
orbs:
android: circleci/android@0.2.1
commands:
install-ndk: android/install-ndk
restore-build-cache: android/restore-build-cache
save-build-cache: android/save-build-cache
quick_build_release_no_tests:
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
- run:
name: Check if assemble required
command: |
last_commit=$(git log -1 --pretty=%B)
if [[ $last_commit != *"Version bump"* ]]; then
circleci-agent step halt
echo "Skipping job"
fi
- install-ndk:
ndk-sha: "c81a5bcb4672a18d3647bf6898cd4dbcb978d0e8"
ndk-version: "android-ndk-r21c"
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run:
name: Quick Build
command: ./gradlew assembleDeviceRelease
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- save-build-cache
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
- run:
name: Skip SonarCloud for external Pull Requests
command: '[[ -v CIRCLE_PR_REPONAME ]] && circleci-agent step halt || true'
- scan-sonar
quick_build_for_testers_no_tests:
executor: android/android
resource_class: large
steps:
- checkout
- run:
name: Check if assemble required
command: |
last_commit=$(git log -1 --pretty=%B)
if [[ $last_commit != *"Version bump"* ]]; then
circleci-agent step halt
echo "Skipping job"
fi
ndk-sha: "c81a5bcb4672a18d3647bf6898cd4dbcb978d0e8"
ndk-version: "android-ndk-r21c"
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run:
command: ./gradlew :Corona-Warn-App:assembleDeviceForTestersRelease
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- save-build-cache
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
device_release_unit_tests:
executor: android/android
resource_class: large
parallelism: 4
steps:
- checkout
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run:
name: test splitting output
command: circleci tests glob "**/test*/**/*.kt" | circleci tests split | xargs -n 1 echo
- run:
name: Unit tests
command: ./gradlew :Corona-Warn-App:testDeviceReleaseUnitTest -i -PtestFilter="`circleci tests glob "**/test*/**/*.kt" | circleci tests split`"
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- save-build-cache
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run:
name: JaCoCo report
command: ./gradlew :Corona-Warn-App:jacocoTestReportDeviceRelease
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
- store_test_results:
path: Corona-Warn-App/build/test-results
device_for_testers_unit_tests:
executor: android/android
resource_class: large
parallelism: 4
steps:
- checkout
- restore-build-cache
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: test splitting output
command: circleci tests glob "**/test*/**/*.kt" | circleci tests split | xargs -n 1 echo
- run:
name: Unit tests
command: ./gradlew :Corona-Warn-App:testDeviceForTestersReleaseUnitTest -i -PtestFilter="`circleci tests glob "**/test*/**/*.kt" | circleci tests split`"
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- save-build-cache
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
- store_test_results:
path: Corona-Warn-App/build/test-results
lint_device_release_check:
executor: android/android
resource_class: large
steps:
- checkout
- run:
name: Lint check device release
command: ./gradlew --profile :Corona-Warn-App:lintDeviceRelease
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
ktlint_device_release_check:
executor: android/android
resource_class: medium
steps:
- checkout
- run:
name: Ktlint check device release
command: ./gradlew :Corona-Warn-App:ktlintDeviceReleaseCheck
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
lint_device_for_testers_check:
executor: android/android
resource_class: large
steps:
- checkout
- run:
name: Lint check device for testers
command: ./gradlew --profile :Corona-Warn-App:lintDeviceForTestersRelease
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
ktlint_device_for_testers_check:
executor: android/android
resource_class: medium
steps:
- checkout
- run:
name: Ktlint check device for testers
command: ./gradlew :Corona-Warn-App:ktlintDeviceForTestersReleaseCheck
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
detekt:
executor: android/android
resource_class: medium
steps:
- checkout
- run:
name: Detekt check
command: ./gradlew :Corona-Warn-App:detekt
environment:
JVM_OPTS: -Xmx2048m
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
- store_artifacts:
path: Corona-Warn-App/build/reports
destination: reports
- quick_build_release_no_tests
- quick_build_for_testers_no_tests
- device_release_unit_tests
- device_for_testers_unit_tests
- lint_device_release_check
- lint_device_for_testers_check
- ktlint_device_release_check
- ktlint_device_for_testers_check
- detekt