diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 513ff923b..59d5a96d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,7 +220,7 @@ jobs: instrumentation-tests: name: Instrumentation tests - runs-on: macos-latest + runs-on: ubuntu-latest timeout-minutes: 20 strategy: # Allow tests to continue on other devices if they fail on one device. @@ -238,23 +238,57 @@ jobs: java-version: '17' check-latest: true - - name: Instrumentation Tests + - name: Enable KVM + 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: AVD cache + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # 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@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2 with: api-level: ${{ matrix.api-level }} + arch: x86_64 + disable-animations: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + force-avd-creation: false + profile : Galaxy Nexus + ram-size : 4096M target: default + script: echo "Generated AVD snapshot for caching." + + - name: Instrumentation Tests + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2 + with: + api-level: ${{ matrix.api-level }} arch: x86_64 + disable-animations: true + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + force-avd-creation: false + profile : Galaxy Nexus + ram-size : 4096M + target: default script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace - name: Upload results uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 with: - name: insrumentation-test-results + name: instrumentation-test-results path: ./**/build/reports/androidTests/connected/** gradle-integration-tests: name: Gradle integration tests - runs-on: macos-14 + runs-on: macos-latest timeout-minutes: 25 steps: