Skip to content

Commit dd24b02

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

File tree

1 file changed

+37
-12
lines changed

1 file changed

+37
-12
lines changed

.github/workflows/ci.yaml

+37-12
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,53 @@ 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+
target: ${{ matrix.target }}
71+
arch: ${{ matrix.arch }}
72+
force-avd-creation: false
73+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
74+
disable-animations: false
75+
script: echo "Generated AVD snapshot for caching."
5476

55-
- name: UI test
77+
- name: Run tests
5678
uses: reactivecircus/android-emulator-runner@v2
5779
with:
5880
api-level: ${{ matrix.api-level }}
81+
target: ${{ matrix.target }}
82+
arch: ${{ matrix.arch }}
83+
force-avd-creation: false
84+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
5985
disable-animations: true
60-
arch: x86_64
6186
script: ./gradlew connectedCheck

0 commit comments

Comments
 (0)