From 84fb835a4529bc71cf80103c223a786b7073dcb3 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Tue, 19 Dec 2023 11:38:01 +0200 Subject: [PATCH] [CI] Update target matrix, depend on build before running emulators --- .github/workflows/build.yml | 94 +++++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8ac0bff..38ee8a6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ permissions: statuses: none jobs: - buildLibrary: + build: if: "!contains(github.event.head_commit.message, '[SkipCI]')" runs-on: ubuntu-22.04 steps: @@ -72,48 +72,74 @@ jobs: path: ~/.m2 if-no-files-found: error - runInstrumentedTests: + instrumentedTests-aosp_atd-target: # Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator runs-on: macos-13 - name: ${{ matrix.api-level }} ${{ matrix.arch }} + name: android-${{ matrix.api-level }} on ${{ matrix.arch }} (${{ matrix.api-type-target }}) + needs: build strategy: fail-fast: false matrix: - api-level: [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34] - arch: [x86, x86_64] - api-type-target: [default] - exclude: - - api-level: 30 - arch: x86 - api-type-target: default - - api-level: 31 - arch: x86 - api-type-target: default - - api-level: 32 - arch: x86 - api-type-target: default - - api-level: 33 - arch: x86 - api-type-target: default - - api-level: 34 - arch: x86 - api-type-target: default + api-level: [30, 31, 32, 33, 34] + arch: [x86_64] + api-type-target: [aosp_atd] include: - api-level: 30 arch: x86 api-type-target: aosp_atd - - api-level: 31 - arch: x86 - api-type-target: aosp_atd - - api-level: 32 - arch: x86 - api-type-target: aosp_atd - - api-level: 33 - arch: x86 - api-type-target: aosp_atd - - api-level: 34 - arch: x86 - api-type-target: aosp_atd + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - uses: android-actions/setup-android@v3 + + - uses: reactivecircus/android-emulator-runner@v2 + with: + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save + api-level: ${{ matrix.api-level }} + arch: ${{ matrix.arch }} + target: ${{ matrix.api-type-target }} + sdcard-path-or-size: 1G + disk-size: 8G + script: | + mkdir -p testResults/screenshots + adb logcat > testResults/logcat.txt & + + adb shell screencap /data/local/tmp/beforeTests.png + adb pull /data/local/tmp/beforeTests.png testResults/screenshots/ + + ./gradlew connectedCheck || touch sorry_but_tests_are_failing + adb pull /sdcard/Pictures/screenshots testResults/ || true + + adb shell screencap /data/local/tmp/afterTests.png + adb pull /data/local/tmp/afterTests.png testResults/screenshots/ + + mv pdf2htmlEX/build/reports/androidTests/connected testResults/ + mv pdf2htmlEX/build/outputs/androidTest-results testResults/ + + test ! -f sorry_but_tests_are_failing + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: testResults-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.api-type-target }} + path: testResults + if-no-files-found: error + + instrumentedTests-default-target: + # Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator + runs-on: macos-13 + name: android-${{ matrix.api-level }} on ${{ matrix.arch }} (${{ matrix.api-type-target }}) + needs: build + strategy: + fail-fast: false + matrix: + api-level: [21, 22, 23, 24, 25, 26, 27, 28, 29] + arch: [x86, x86_64] + api-type-target: [default] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4