Skip to content

Commit

Permalink
CI: Enable KVM and caching of AVD
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Jul 20, 2024
1 parent 198da5e commit fb4b67c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,28 @@ jobs:
id: setup-ndk
with:
ndk-version: r26d
- 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@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create AVD and 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 -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Configure CMake
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
Expand Down Expand Up @@ -335,7 +357,6 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
target: default
arch: x86_64 # Fixed for now
script: |
${{github.workspace}}/.github/scripts/android_test_main.sh ${{github.workspace}}/build ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot ${{ matrix.arch.triple }}
Expand Down

0 comments on commit fb4b67c

Please sign in to comment.