From 9a651b223b6c6b9e6ccfe643c49e7ae084bf957e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 13 Sep 2022 13:18:18 +0200 Subject: [PATCH 01/11] Use `buildjet-4vcpu-ubuntu-2204` runner instead of `macos-latest` to build and run the integration tests. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cd7e26f3cf..8a0d320bbf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ env: jobs: tests: name: Runs all tests - runs-on: macos-latest # for the emulator + runs-on: buildjet-4vcpu-ubuntu-2204 # for the emulator # 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) }} From 2e8b6e4eb9a7576ce51058b593033b288f2053d8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 13 Sep 2022 14:40:26 +0200 Subject: [PATCH 02/11] typo --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a0d320bbf..148a026b84 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: ./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 stes.tests.outcome = 'failure' + # 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. From 6ac9a7627b451c84760b1ebf463f0ace34b693ff Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 13 Sep 2022 14:42:39 +0200 Subject: [PATCH 03/11] Disable 2nd attempt to run the tests. --- .github/workflows/tests.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 148a026b84..ffffb2b760 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,22 +54,22 @@ jobs: ./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 + ### - 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 # we may have failed a previous step and retried, that's OK - name: Publish results to Sonar From 1afe0981a68ba472ccad834791dde9281a6750d4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 13 Sep 2022 14:47:35 +0200 Subject: [PATCH 04/11] Use `buildjet-4vcpu-ubuntu-2204` runner instead of `macos-latest` to build and run the integration tests for the post merge task. --- .github/workflows/post-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index 5cde95e625..bf948064ed 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -31,7 +31,7 @@ jobs: ui-tests: name: UI Tests (Synapse) needs: should-i-run - runs-on: macos-latest + runs-on: buildjet-4vcpu-ubuntu-2204 strategy: fail-fast: false matrix: From 0685fb1e1a16cb2dce12ed2e2785db31e8efab46 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 16 Sep 2022 19:03:19 +0200 Subject: [PATCH 05/11] Changelog --- changelog.d/7108.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/7108.misc diff --git a/changelog.d/7108.misc b/changelog.d/7108.misc new file mode 100644 index 0000000000..d4b15a0222 --- /dev/null +++ b/changelog.d/7108.misc @@ -0,0 +1 @@ +Move some GitHub action to buildjet runner, and remove the second attempt to run integration tests. From 75236e9ed05cc1b08d4d15aed3c18422b76be921 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Sep 2022 10:17:05 +0200 Subject: [PATCH 06/11] Start with `buildjet-2vcpu-ubuntu-2204` --- .github/workflows/post-pr.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index bf948064ed..8eff24b0c8 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -31,7 +31,7 @@ jobs: ui-tests: name: UI Tests (Synapse) needs: should-i-run - runs-on: buildjet-4vcpu-ubuntu-2204 + runs-on: buildjet-2vcpu-ubuntu-2204 strategy: fail-fast: false matrix: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ffffb2b760..c63ab593b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ env: jobs: tests: name: Runs all tests - runs-on: buildjet-4vcpu-ubuntu-2204 # for the emulator + runs-on: buildjet-2vcpu-ubuntu-2204 # 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) }} From bf493f27aee9bc214fe60c6a2c93bc996c2fbe62 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Sep 2022 14:31:35 +0200 Subject: [PATCH 07/11] Revert to `buildjet-4vcpu-ubuntu-2204` --- .github/workflows/post-pr.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index 8eff24b0c8..bf948064ed 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -31,7 +31,7 @@ jobs: ui-tests: name: UI Tests (Synapse) needs: should-i-run - runs-on: buildjet-2vcpu-ubuntu-2204 + runs-on: buildjet-4vcpu-ubuntu-2204 strategy: fail-fast: false matrix: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c63ab593b4..e260749374 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ env: jobs: tests: name: Runs all tests - runs-on: buildjet-2vcpu-ubuntu-2204 + runs-on: buildjet-4vcpu-ubuntu-2204 # 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) }} From 0e45494c11e35e9f49c6a6e794548c6be1855bff Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Sep 2022 16:26:38 +0200 Subject: [PATCH 08/11] Comment out `continue-on-error: true` It does not mark the build as failed. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e260749374..cda0bd5e31 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: - name: Run all the codecoverage tests at once id: tests uses: reactivecircus/android-emulator-runner@v2 - continue-on-error: true + # continue-on-error: true with: api-level: 28 arch: x86 From 0c28384ece527f78f8fe86bed89d47e990f05a9a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Sep 2022 18:12:19 +0200 Subject: [PATCH 09/11] Create AVD and generate snapshot for caching. Also force AVD creation when no cache hit --- .github/workflows/tests.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cda0bd5e31..07eeec5643 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,9 @@ 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) }} @@ -36,18 +39,39 @@ jobs: httpPort: 8080 disableRateLimiting: true public_baseurl: "http://10.0.2.2:8080/" + + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + arch: x86 + profile: Nexus 5X + force-avd-creation: true # Is set to false in the doc https://github.com/ReactiveCircus/android-emulator-runner + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: echo "Generated AVD snapshot for caching." + - name: Run all the codecoverage tests at once - id: tests uses: reactivecircus/android-emulator-runner@v2 # continue-on-error: true with: - api-level: 28 + api-level: ${{ matrix.api-level }} 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 + # emulator-build: 7425822 script: | ./gradlew gatherGplayDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES ./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES From aa010dedff4e9070a559410eaa4fe9d896cd3699 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Sep 2022 18:36:01 +0200 Subject: [PATCH 10/11] Try to upload integration test report log --- .github/workflows/tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 07eeec5643..fb8e3080ae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,6 +95,15 @@ jobs: ### ./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() + with: + name: integration-test-error-results + path: | + */build/outputs/androidTest-results/connected/ + */build/reports/androidTests/connected/ + # we may have failed a previous step and retried, that's OK - name: Publish results to Sonar env: From d8ff688e76cf29a99f2649142a4a3d5e942a9e92 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 20 Sep 2022 09:51:22 +0200 Subject: [PATCH 11/11] Fix typo in changelog. Co-authored-by: manuroe --- changelog.d/7108.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/7108.misc b/changelog.d/7108.misc index d4b15a0222..165bd52e57 100644 --- a/changelog.d/7108.misc +++ b/changelog.d/7108.misc @@ -1 +1 @@ -Move some GitHub action to buildjet runner, and remove the second attempt to run integration tests. +Move some GitHub actions to buildjet runners, and remove the second attempt to run integration tests.