diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 5549767b6..b8454a85f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -25,7 +25,7 @@ jobs: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Android')) name: Run all tests - runs-on: macos-12 + runs-on: ubuntu-latest strategy: matrix: api-level: [31] @@ -57,28 +57,34 @@ jobs: :library:assembleDebugUnitTest :library:assembleDebugAndroidTest ${{ env.CI_GRADLE_ARG_PROPERTIES }} cache-read-only: false -# - name: AVD cache -# uses: actions/cache@v3 -# id: avd-cache -# with: -# path: | -# ~/.android/avd/* -# ~/.android/adb* -# key: avd-${{ matrix.api-level }} + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm -# - name: Create AVD and generate snapshot for caching -# if: steps.avd-cache.outputs.cache-hit != 'true' -# uses: reactivecircus/android-emulator-runner@v2 -# with: -# working-directory: platforms/android -# api-level: ${{ matrix.api-level }} -# profile: ${{ env.DEVICE }} -# arch: ${{ env.ARCH }} -# force-avd-creation: false -# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -# disable-animations: true -# enable-hw-keyboard: true -# script: echo "Generated AVD snapshot for caching." + - 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: + working-directory: platforms/android + api-level: ${{ matrix.api-level }} + profile: ${{ env.DEVICE }} + arch: ${{ env.ARCH }} + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + enable-hw-keyboard: true + script: echo "Generated AVD snapshot for caching." - name: Run all tests with coverage uses: reactivecircus/android-emulator-runner@v2