From 34438eba9f0e138f5ad681f45510607ff0b4c5da Mon Sep 17 00:00:00 2001 From: ujizin Date: Sun, 8 Sep 2024 16:43:44 +0100 Subject: [PATCH] ci: add cache and api target 31 --- .github/workflows/android_test.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/android_test.yml b/.github/workflows/android_test.yml index 6c7292b..e9331c1 100644 --- a/.github/workflows/android_test.yml +++ b/.github/workflows/android_test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - api-level: [21, 26, 29] + api-level: [21, 26, 29, 31] include: - api-level: 21 arch: 'x86' @@ -18,6 +18,8 @@ jobs: arch: 'x86_64' - api-level: 29 arch: 'x86_64' + - api-level: 31 + arch: 'x86_64' steps: - name: checkout uses: actions/checkout@v4 @@ -37,6 +39,28 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm + - name: Gradle cache + uses: gradle/actions/setup-gradle@v3 + + - name: AVD cache + uses: actions/cache@v4 + 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 }} + force-avd-creation: false + emulator-options: -no-window -no-boot-anim -camera-back emulated -camera-front emulated -gpu swiftshader_indirect + disable-animations: false + script: echo "Generated AVD snapshot for caching." + - name: run android tests uses: reactivecircus/android-emulator-runner@v2 with: