Skip to content

Commit

Permalink
fix(ci): android emulator not working for x86 image on an arm64 host …
Browse files Browse the repository at this point in the history
…OS (macOS)
  • Loading branch information
asdolo committed Jun 28, 2024
1 parent 4d568b4 commit 414eda0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-jdk-generate-apk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: Generate Test APK
run: |
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/e2e-android-eas-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
test-android:
name: E2E Tests EAS Build Android (Maestro + Github Action)
needs: download-eas-apk
runs-on: macOS-latest
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout project repo
Expand All @@ -58,7 +58,7 @@ jobs:
path: ${{ github.workspace }}

- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v3
Expand All @@ -69,11 +69,18 @@ jobs:
~/.android/adb*
key: avd-cache

- 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:
api-level: 29
arch: arm64-v8a
api-level: 30
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
Expand All @@ -85,7 +92,8 @@ jobs:
- name: Run tests with Maestro
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: arm64-v8a
api-level: 30
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
test-android:
name: Run Android E2E Tests (Maestro + Github Action)
needs: generate-test-apk
runs-on: macOS-latest
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout project repo
Expand All @@ -66,7 +66,7 @@ jobs:
path: ${{ github.workspace }}

- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: AVD cache
uses: actions/cache@v3
Expand All @@ -77,23 +77,33 @@ jobs:
~/.android/adb*
key: avd-cache

- 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:
api-level: 29
arch: x86_64
api-level: 30
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
cores: 2
ram-size: 4096M
disk-size: 6000M
heap-size: 600M
profile: Nexus 6
script: echo "Generated AVD snapshot for caching."

- name: Run tests with Maestro
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: arm64-v8a
api-level: 30
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
Expand Down

0 comments on commit 414eda0

Please sign in to comment.