Skip to content

Commit

Permalink
Merge pull request #2662 from square/py/fix_ci
Browse files Browse the repository at this point in the history
Fix Emulators in CI broken by MacOS switching to ARM. Back to Ubuntu, now faster with KVM
  • Loading branch information
pyricau committed Apr 30, 2024
2 parents 5e37dd6 + 805d07f commit 3501232
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
run: ./gradlew build --stacktrace

instrumentation-tests:
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
# Allow tests to continue on other devices if they fail on one device.
Expand Down Expand Up @@ -55,20 +55,26 @@ jobs:
# target: aosp_atd
# channel: canary
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- 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
ls /dev/kvm
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
key: avd-cached-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -84,6 +90,7 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
Expand Down

0 comments on commit 3501232

Please sign in to comment.