Skip to content

Commit

Permalink
Fix build break of Android test
Browse files Browse the repository at this point in the history
Signed-off-by: kexuan.yang <[email protected]>
  • Loading branch information
yangkx1024 committed Apr 29, 2024
1 parent d4b8c4a commit e14f663
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,39 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
- name: Enable KVM
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: Gradle cache
uses: gradle/actions/setup-gradle@v3

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

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
api-level: 34
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching."

- name: Prepare Gradle build
env:
Expand All @@ -43,6 +65,8 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis_playstore
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: cd ./android; ./gradlew connectedAndroidTest

0 comments on commit e14f663

Please sign in to comment.