Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
android-build:
runs-on: macos-13 # emulator never starts on macOS 14 https://github.com/ReactiveCircus/android-emulator-runner/issues/392#issuecomment-2106167725
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-android
cancel-in-progress: true
Expand All @@ -41,26 +41,47 @@ jobs:
run: bun run build:android
working-directory: example

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-35-arm64-x86_64

- 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

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
with:
# Use the slimmer aosp_atd images for working
# around "System UI isn't responding" ANR
# (Application Not Responding) error
#
# https://android-developers.googleblog.com/2021/10/whats-new-in-scalable-automated-testing.html#:~:text=Slimmer%20Emulator%20System%20Images
# https://github.com/ReactiveCircus/android-emulator-runner/issues/129
# https://github.com/upleveled/hotline-bling-codealong/pull/26#issuecomment-1094659722
target: aosp_atd
api-level: 30
arch: x86
api-level: 35
arch: x86_64
ram-size: 4096M
channel: canary
profile: pixel
avd-name: Pixel_3a_API_30_AOSP
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-boot-timeout: 12000
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run build
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
with:
api-level: 35
arch: x86_64
profile: pixel
avd-name: Pixel_3a_API_30_AOSP
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-boot-timeout: 12000
disable-animations: false
script: |
bun example:android:release
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ buildscript {
}())

repositories {
mavenCentral()
google()
mavenCentral()
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"example:start": "cd example; bun start",
"example:android": "cd example; bun android",
"example:ios": "cd example; bun ios",
"example:android:release": "cd example;react-native run-android --mode \"Release\" --appId com.pagerviewexample",
"example:android:release": "cd example;react-native run-android --mode \"Release\" --appId com.pagerviewexample --active-arch-only",
"example:ios:release": "cd example;react-native run-ios --mode \"Release\""
},
"keywords": [
Expand Down