Skip to content

Commit 370d272

Browse files
committed
Fix UI test in ci.yaml
1 parent 8ea3cb4 commit 370d272

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

.github/workflows/ci.yaml

+33-12
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,49 @@ jobs:
3434

3535
ui-test:
3636
name: UI tests on Android (API level ${{ matrix.api-level }})
37-
runs-on: macos-latest
37+
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
api-level: [ 26, 28, 34 ]
40+
api-level: [ 26, 28, 33 ]
41+
target: [ google_apis ]
42+
arch: [ x86_64 ]
4143
steps:
4244
- name: Checkout
43-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4446

45-
- name: Setup JDK 17
46-
uses: actions/setup-java@v3
47+
- name: Enable KVM
48+
run: |
49+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
50+
sudo udevadm control --reload-rules
51+
sudo udevadm trigger --name-match=kvm
52+
53+
- name: Gradle cache
54+
uses: gradle/actions/setup-gradle@v3
55+
56+
- name: AVD cache
57+
uses: actions/cache@v4
58+
id: avd-cache
4759
with:
48-
java-version: '17'
49-
distribution: 'temurin'
50-
cache: gradle
60+
path: |
61+
~/.android/avd/*
62+
~/.android/adb*
63+
key: avd-${{ matrix.api-level }}
5164

52-
- name: Setup Android SDK
53-
uses: android-actions/setup-android@v2
65+
- name: Create AVD and generate snapshot for caching
66+
if: steps.avd-cache.outputs.cache-hit != 'true'
67+
uses: reactivecircus/android-emulator-runner@v2
68+
with:
69+
api-level: ${{ matrix.api-level }}
70+
force-avd-creation: false
71+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
72+
disable-animations: false
73+
script: echo "Generated AVD snapshot for caching."
5474

55-
- name: UI test
75+
- name: Run tests
5676
uses: reactivecircus/android-emulator-runner@v2
5777
with:
5878
api-level: ${{ matrix.api-level }}
79+
force-avd-creation: false
80+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
5981
disable-animations: true
60-
arch: x86_64
6182
script: ./gradlew connectedCheck

0 commit comments

Comments
 (0)