Skip to content

Commit b1c9fa7

Browse files
authored
ci: Enable KVM group perms (#999)
1 parent 8002694 commit b1c9fa7

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/functional-test.yml

+28-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
_FORCE_LOGS: 1
4747
# No hardware acceleration is available for emulators on Ubuntu:
4848
# https://github.com/marketplace/actions/android-emulator-runner#can-i-use-this-action-on-linux-vms
49-
runs-on: macos-latest
49+
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v3
5252
- uses: actions/setup-node@v3
@@ -56,7 +56,31 @@ jobs:
5656
- uses: actions/setup-java@v3
5757
with:
5858
distribution: 'temurin'
59-
java-version: '11'
59+
java-version: '17'
60+
- name: Enable KVM group perms
61+
run: |
62+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
63+
sudo udevadm control --reload-rules
64+
sudo udevadm trigger --name-match=kvm
65+
- name: Setup Android SDK
66+
uses: android-actions/setup-android@v3
67+
- name: AVD cache
68+
uses: actions/cache@v3
69+
id: avd-cache
70+
with:
71+
path: |
72+
~/.android/avd/*
73+
~/.android/adb*
74+
key: avd-${{ matrix.apiLevel }}
75+
- name: create AVD and generate snapshot for caching
76+
if: steps.avd-cache.outputs.cache-hit != 'true'
77+
uses: reactivecircus/android-emulator-runner@v2
78+
with:
79+
api-level: ${{ matrix.api-level }}
80+
force-avd-creation: false
81+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
82+
disable-animations: false
83+
script: echo "Generated AVD snapshot for caching."
6084
- run: |
6185
npm install -g appium
6286
npm install --chromedriver_version="${{ matrix.chromedriverVersion }}"
@@ -87,13 +111,12 @@ jobs:
87111
with:
88112
script: npx mocha --timeout 10m ./test/functional/driver-e2e-specs.js ./test/functional/commands/jetpack-compose-attributes-e2e-specs.js -g @skip-ci -i --exit
89113
avd-name: ${{ env.ANDROID_AVD }}
90-
sdcard-path-or-size: 1500M
114+
force-avd-creation: false
91115
api-level: ${{ matrix.apiLevel }}
92116
disable-spellchecker: true
117+
disable-animations: true
93118
target: ${{ matrix.emuTag }}
94119
arch: ${{ matrix.arch }}
95-
ram-size: 4096M
96-
heap-size: 1024M
97120
- name: Save logcat output
98121
if: ${{ always() }}
99122
uses: actions/upload-artifact@master

0 commit comments

Comments
 (0)