Skip to content
Closed
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
44 changes: 44 additions & 0 deletions .github/actions/setup-android-emulator/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Setup Android Emulator
description: Download system image, create AVD, and boot Android emulator

inputs:
api_level:
description: 'Android API level'
required: false
default: '30'
device:
description: 'Android device profile'
required: false
default: 'Nexus 5X'
avd_name:
description: 'AVD name'
required: false
default: 'test_avd'

runs:
using: composite
steps:
- name: Download Android system image
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-${{ inputs.api_level }};default;arm64-v8a"
shell: bash

- name: Create Android emulator
run: |
echo "Creating Android emulator..."
$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
shell: bash

- name: Boot Android emulator
run: |
echo "Starting Android emulator in background..."
# ARM64 macOS runners don't support HVF. Use -engine classic to force QEMU TCG software emulation
$ANDROID_HOME/emulator/emulator -engine classic -avd ${{ inputs.avd_name }} -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim &
shell: bash

- name: Wait for emulator to boot
run: |
echo "Waiting for Android emulator to boot..."
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
echo "Emulator is ready"
adb devices
shell: bash
20 changes: 7 additions & 13 deletions .github/workflows/ci-graphite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:

test-android-graphite:
needs: build-android-graphite
runs-on: macos-latest-large
runs-on: macos-latest-xlarge
timeout-minutes: 60
env:
TURBO_CACHE_DIR: .turbo/android
Expand All @@ -196,19 +196,13 @@ jobs:
with:
path: apps/example/android/app/build/outputs/apk/debug/app-debug.apk
key: apk-${{ github.sha }}

- name: SKDs - download required images
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;default;x86_64"

- name: Emulator - Create
run: $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_30 --device 'Nexus 5X' --package "system-images;android-30;default;x86_64" --sdcard 512M

- name: Emulator - Boot
run: $ANDROID_HOME/emulator/emulator -memory 4096 -avd Pixel_API_30 -wipe-data -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim &

- name: ADB Wait For Device
run: adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
timeout-minutes: 10
- name: Setup Android Emulator
uses: ./.github/actions/setup-android-emulator
with:
api_level: '30'
device: 'Nexus 5X'
avd_name: 'Pixel_API_30'

- name: Start Package Manager
working-directory: apps/example/
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:

test-android:
needs: build-android
runs-on: macos-latest-large
runs-on: macos-latest-xlarge
timeout-minutes: 60
env:
TURBO_CACHE_DIR: .turbo/android
Expand All @@ -287,19 +287,13 @@ jobs:
with:
path: apps/example/android/app/build/outputs/apk/debug/app-debug.apk
key: apk-${{ github.sha }}

- name: SKDs - download required images
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-30;default;x86_64"

- name: Emulator - Create
run: $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n Pixel_API_30 --device 'Nexus 5X' --package "system-images;android-30;default;x86_64" --sdcard 512M

- name: Emulator - Boot
run: $ANDROID_HOME/emulator/emulator -memory 4096 -avd Pixel_API_30 -wipe-data -no-window -gpu angle_indirect -no-snapshot -noaudio -no-boot-anim &

- name: ADB Wait For Device
run: adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
timeout-minutes: 10
- name: Setup Android Emulator
uses: ./.github/actions/setup-android-emulator
with:
api_level: '30'
device: 'Nexus 5X'
avd_name: 'Pixel_API_30'

- name: Start Package Manager
working-directory: apps/example/
Expand Down
27 changes: 6 additions & 21 deletions .github/workflows/test-skia-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:

test-skia-android:
if: inputs.test_android
runs-on: macos-latest-large
runs-on: macos-latest-xlarge
timeout-minutes: 60

steps:
Expand Down Expand Up @@ -225,14 +225,6 @@ jobs:
distribution: 'zulu'
java-version: '17'

- name: Download Android system image
run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "system-images;android-${{ inputs.android_api_level }};default;x86_64"

- name: Create Android emulator
run: |
echo "Creating Android emulator..."
$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n test_avd --device '${{ inputs.android_device }}' --package "system-images;android-${{ inputs.android_api_level }};default;x86_64" --sdcard 512M --force

- name: Create test directory
run: |
mkdir -p /Users/runner/skia-test-app
Expand Down Expand Up @@ -301,18 +293,11 @@ jobs:
echo "Generating native Android directory..."
npx expo prebuild --platform android

- name: Start Android emulator
run: |
echo "Starting Android emulator in background..."
$ANDROID_HOME/emulator/emulator -memory 4096 -avd test_avd -wipe-data -no-window -gpu angle_indirect -no-snapshot -noaudio -no-boot-anim &

- name: Wait for emulator to boot
run: |
echo "Waiting for Android emulator to boot..."
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
echo "Emulator is ready"
adb devices
timeout-minutes: 10
- name: Setup Android Emulator
uses: ./.github/actions/setup-android-emulator
with:
api_level: ${{ inputs.android_api_level }}
device: ${{ inputs.android_device }}

- name: Start Metro bundler
working-directory: /Users/runner/skia-test-app/my-app
Expand Down
2 changes: 1 addition & 1 deletion externals/depot_tools
Submodule depot_tools updated from 8a1ec6 to abc510
Loading