Skip to content

Commit

Permalink
replace macos with ubuntu and cache VM
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-zimerman authored Nov 20, 2024
1 parent 379b60e commit e2559d2
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/android-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
run:
name: try-${{ inputs.try }}
runs-on: macos-13
runs-on: ubuntu-latest
env:
ARTIFACTS_PATH: samples/IntegrationTest/test-artifacts/
HOMEBREW_NO_INSTALL_CLEANUP: 1
Expand All @@ -39,6 +39,13 @@ jobs:
name: testapp-Android-compiled-${{ inputs.unity-version }}
path: samples/IntegrationTest/Build

# Not required for MacOS.
- 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
# outputs variables: api-level, label, target
- name: Configure Android Settings
id: config
Expand All @@ -64,9 +71,34 @@ jobs:
"target=$target" >> $env:GITHUB_OUTPUT
"api-level=$apiLevel" >> $env:GITHUB_OUTPUT
"label=$($label ?? $apiLevel)" >> $env:GITHUB_OUTPUT
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ steps.config.outputs.api-level }}

- name: create Android Emulator Image
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected]
with:
api-level: ${{ steps.config.outputs.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
ram-size: 2048M
arch: x86_64
cores: 3
disk-size: 4096M
script: echo "Generated AVD snapshot for caching."

- name: Android API ${{ steps.config.outputs.label }} emulator setup + Smoke test
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2.28.0
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v233.0
id: smoke-test
timeout-minutes: 40
continue-on-error: true
Expand All @@ -79,7 +111,7 @@ jobs:
cores: 3
emulator-boot-timeout: 1800
disk-size: 4096M # Some runs have out of storage error when installing the smoke test.
emulator-options: -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel on
emulator-options: -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: pwsh ./scripts/smoke-test-android.ps1 -IsIntegrationTest -WarnIfFlaky

Expand Down

0 comments on commit e2559d2

Please sign in to comment.