Skip to content

Commit e5226e8

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

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

.github/workflows/ci.yaml

+34-12
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,50 @@ 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 ]
4141
steps:
4242
- name: Checkout
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444

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

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

55-
- name: UI test
76+
- name: Run tests
5677
uses: reactivecircus/android-emulator-runner@v2
5778
with:
5879
api-level: ${{ matrix.api-level }}
80+
force-avd-creation: false
81+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
5982
disable-animations: true
60-
arch: x86_64
6183
script: ./gradlew connectedCheck

0 commit comments

Comments
 (0)