1414
1515jobs :
1616 android-build :
17- runs-on : macos-13 # emulator never starts on macOS 14 https://github.com/ReactiveCircus/android-emulator-runner/issues/392#issuecomment-2106167725
17+ runs-on : ubuntu-latest
1818 concurrency :
1919 group : ${{ github.ref }}-android
2020 cancel-in-progress : true
@@ -41,26 +41,47 @@ jobs:
4141 run : bun run build:android
4242 working-directory : example
4343
44+ - name : AVD cache
45+ uses : actions/cache@v4
46+ id : avd-cache
47+ with :
48+ path : |
49+ ~/.android/avd/*
50+ ~/.android/adb*
51+ key : avd-35-arm64-x86_64
52+
53+ - name : Enable KVM group perms
54+ run : |
55+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
56+ sudo udevadm control --reload-rules
57+ sudo udevadm trigger --name-match=kvm
58+ ls /dev/kvm
59+
4460 - name : Create AVD and generate snapshot for caching
61+ if : steps.avd-cache.outputs.cache-hit != 'true'
4562 uses : reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
4663 with :
47- # Use the slimmer aosp_atd images for working
48- # around "System UI isn't responding" ANR
49- # (Application Not Responding) error
50- #
51- # https://android-developers.googleblog.com/2021/10/whats-new-in-scalable-automated-testing.html#:~:text=Slimmer%20Emulator%20System%20Images
52- # https://github.com/ReactiveCircus/android-emulator-runner/issues/129
53- # https://github.com/upleveled/hotline-bling-codealong/pull/26#issuecomment-1094659722
54- target : aosp_atd
55- api-level : 30
56- arch : x86
64+ api-level : 35
65+ arch : x86_64
5766 ram-size : 4096M
58- channel : canary
5967 profile : pixel
6068 avd-name : Pixel_3a_API_30_AOSP
6169 force-avd-creation : false
6270 emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
6371 emulator-boot-timeout : 12000
6472 disable-animations : false
73+ script : echo "Generated AVD snapshot for caching."
74+
75+ - name : Run build
76+ uses : reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
77+ with :
78+ api-level : 35
79+ arch : x86_64
80+ profile : pixel
81+ avd-name : Pixel_3a_API_30_AOSP
82+ force-avd-creation : false
83+ emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
84+ emulator-boot-timeout : 12000
85+ disable-animations : false
6586 script : |
6687 bun example:android:release
0 commit comments