Skip to content
Snippets Groups Projects
Commit 3dc5a8f0 authored by Matthias Urhahn's avatar Matthias Urhahn
Browse files

Merge branch 'release/1.5.x' into fix/1.5.x-into-1.6.x

parents 0ee295b1 25ba3e30
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,56 @@ commands: ...@@ -8,10 +8,56 @@ commands:
save-build-cache: android/save-build-cache save-build-cache: android/save-build-cache
scan-sonar: sonarcloud/scan scan-sonar: sonarcloud/scan
jobs: jobs:
quickBuildReleaseWithTestsAndChecks: quick_build_release_no_tests:
executor: android/android executor: android/android
resource_class: large
steps: steps:
- checkout - 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
- 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
- install-ndk: - install-ndk:
ndk-sha: "c81a5bcb4672a18d3647bf6898cd4dbcb978d0e8" ndk-sha: "c81a5bcb4672a18d3647bf6898cd4dbcb978d0e8"
ndk-version: "android-ndk-r21c" ndk-version: "android-ndk-r21c"
...@@ -20,7 +66,33 @@ jobs: ...@@ -20,7 +66,33 @@ jobs:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }} key: jars-{{ checksum "build.gradle" }}-{{ checksum "Corona-Warn-App/build.gradle" }}-{{ checksum "Server-Protocol-Buffer/build.gradle" }}
- run: - run:
name: Quick Build name: Quick Build
command: ./gradlew quickBuild quickBuildTest 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: environment:
JVM_OPTS: -Xmx2048m 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 GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
...@@ -40,12 +112,114 @@ jobs: ...@@ -40,12 +112,114 @@ jobs:
destination: reports destination: reports
- store_test_results: - store_test_results:
path: Corona-Warn-App/build/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" }}
- run: - run:
name: Skip SonarCloud for external Pull Requests name: test splitting output
command: '[[ -v CIRCLE_PR_REPONAME ]] && circleci-agent step halt || true' command: circleci tests glob "**/test*/**/*.kt" | circleci tests split | xargs -n 1 echo
- scan-sonar - 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
workflows: workflows:
version: 2 version: 2
workflow: quick_build:
jobs: jobs:
- quickBuildReleaseWithTestsAndChecks - 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
...@@ -129,6 +129,16 @@ android { ...@@ -129,6 +129,16 @@ android {
testOptions { testOptions {
unitTests.all { unitTests.all {
useJUnitPlatform() useJUnitPlatform()
if (project.hasProperty('testFilter')) {
List<String> props = project.getProperties().get("testFilter").split("\\s+")
props.each {
def replaced = it
.replaceFirst("^(Corona-Warn-App/src/test.*/java/)(.+)\$", "**/\$2")
.replace(".kt", ".class")
project.logger.lifecycle("testFilter File: before=$it, after=$replaced")
include(replaced)
}
}
} }
unitTests { unitTests {
includeAndroidResources = true includeAndroidResources = true
...@@ -173,7 +183,6 @@ android { ...@@ -173,7 +183,6 @@ android {
java.srcDirs += "$projectDir/src/testShared/java" java.srcDirs += "$projectDir/src/testShared/java"
} }
} }
} }
task jacocoTestReportDeviceRelease(type: JacocoReport, dependsOn: 'testDeviceReleaseUnitTest') { task jacocoTestReportDeviceRelease(type: JacocoReport, dependsOn: 'testDeviceReleaseUnitTest') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment