Skip to content

Commit adeccf0

Browse files
committed
🔧
1 parent 5de4adb commit adeccf0

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed
Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,44 @@
11
name: Setup Android Emulator
2-
description: Run Android emulator tests using reactivecircus/android-emulator-runner
2+
description: Download system image, create AVD, and boot Android emulator
33

44
inputs:
55
api_level:
66
description: 'Android API level'
77
required: false
88
default: '30'
9-
profile:
9+
device:
1010
description: 'Android device profile'
1111
required: false
1212
default: 'Nexus 5X'
13-
script:
14-
description: 'Script to run inside the emulator'
15-
required: true
13+
avd_name:
14+
description: 'AVD name'
15+
required: false
16+
default: 'test_avd'
1617

1718
runs:
1819
using: composite
1920
steps:
20-
- name: Run tests on Android emulator
21-
uses: reactivecircus/android-emulator-runner@v2
22-
with:
23-
api-level: ${{ inputs.api_level }}
24-
target: default
25-
arch: arm64-v8a
26-
profile: ${{ inputs.profile }}
27-
script: ${{ inputs.script }}
21+
- name: Download Android system image
22+
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-${{ inputs.api_level }};default;arm64-v8a"
23+
shell: bash
24+
25+
- name: Create Android emulator
26+
run: |
27+
echo "Creating Android emulator..."
28+
$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n ${{ inputs.avd_name }} --device '${{ inputs.device }}' --package "system-images;android-${{ inputs.api_level }};default;arm64-v8a" --sdcard 512M --force
29+
shell: bash
30+
31+
- name: Boot Android emulator
32+
run: |
33+
echo "Starting Android emulator in background..."
34+
# ARM64 macOS runners don't support HVF. Use -engine classic to force QEMU TCG software emulation
35+
$ANDROID_HOME/emulator/emulator -engine classic -avd ${{ inputs.avd_name }} -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim &
36+
shell: bash
37+
38+
- name: Wait for emulator to boot
39+
run: |
40+
echo "Waiting for Android emulator to boot..."
41+
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
42+
echo "Emulator is ready"
43+
adb devices
44+
shell: bash

.github/workflows/ci-graphite.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ jobs:
202202
with:
203203
api_level: '30'
204204
device: 'Nexus 5X'
205-
gpu_mode: 'angle_indirect'
206205
avd_name: 'Pixel_API_30'
207206

208207
- name: Start Package Manager

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ jobs:
293293
with:
294294
api_level: '30'
295295
device: 'Nexus 5X'
296-
gpu_mode: 'angle_indirect'
297296
avd_name: 'Pixel_API_30'
298297

299298
- name: Start Package Manager

.github/workflows/test-skia-package.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ jobs:
298298
with:
299299
api_level: ${{ inputs.android_api_level }}
300300
device: ${{ inputs.android_device }}
301-
gpu_mode: 'angle_indirect'
302301

303302
- name: Start Metro bundler
304303
working-directory: /Users/runner/skia-test-app/my-app

0 commit comments

Comments
 (0)