Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #929 from matrix-org/misc/set-ubuntu-latest-runner…
Browse files Browse the repository at this point in the history
…-for-android-with-kvm

Set runner to `ubuntu-latest`, enable KVM
  • Loading branch information
jmartinesp authored Feb 1, 2024
2 parents aff8223 + 70c1e9c commit b814ed4
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b814ed4

Please sign in to comment.