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: