From 5d3e732a03415b0b7a6d7b71fc60ed8129e8b0ab Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 12 Oct 2022 13:17:20 +0200 Subject: [PATCH] Try to use Gradle managed devices. CI configuration. --- .github/workflows/tests.yml | 44 +++++-------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1816fe3a78..7863959038 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,15 +8,12 @@ on: # Enrich gradle.properties for CI/CD env: GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false - CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" jobs: tests: name: Runs all tests runs-on: buildjet-4vcpu-ubuntu-2204 - strategy: - matrix: - api-level: [28] # Allow all jobs on main and develop. Just one per PR. concurrency: group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }} @@ -58,40 +55,11 @@ jobs: public_baseurl: "http://10.0.2.2:8080/" - name: Run all the codecoverage tests at once - uses: reactivecircus/android-emulator-runner@v2 - # continue-on-error: true - with: - api-level: ${{ matrix.api-level }} - arch: x86 - profile: Nexus 5X - target: playstore - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - # emulator-build: 7425822 - script: | - ./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES - ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES - ./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES - ./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES - # NB: continue-on-error marks steps.tests.conclusion = 'success' but leaves steps.tests.outcome = 'failure' - ### - name: Run all the codecoverage tests at once (retry if emulator failed) - ### uses: reactivecircus/android-emulator-runner@v2 - ### if: always() && steps.tests.outcome == 'failure' # don't run if previous step succeeded. - ### with: - ### api-level: 28 - ### arch: x86 - ### profile: Nexus 5X - ### force-avd-creation: false - ### emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - ### disable-animations: true - ### emulator-build: 7425822 - ### script: | - ### ./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES - ### ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES - ### ./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES - ### ./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES - + run: | + ./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES + ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES + ./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES + ./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES - name: Upload Integration Test Report Log uses: actions/upload-artifact@v3 if: always()