Skip to content

Commit d4450b6

Browse files
Use Larger Runner Group for kotlin.yml Workflow
Add KVM Permissions to Instrumentation Tests in order to use hardware acceleration for the Android emulator.
1 parent 1699447 commit d4450b6

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/actions/gradle-tasks-with-emulator/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ runs :
3131
using : 'composite'
3232
steps :
3333

34+
# Setup the runner in the KVM group to enable HW Accleration for the emulator.
35+
# see https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
36+
- name: Enable KVM group perms
37+
run: |
38+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
39+
sudo udevadm control --reload-rules
40+
sudo udevadm trigger --name-match=kvm
41+
3442
# Create or fetch the artifacts used for these tests.
3543
- name : Run ${{ inputs.prepare-task }}
3644
uses : ./.github/actions/gradle-task

.github/workflows/kotlin.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on :
44
push :
55
branches :
66
- main
7-
pull_request :
7+
pull_request_target :
8+
branches :
9+
- main
810
merge_group :
911

1012
env:
@@ -19,7 +21,7 @@ jobs :
1921

2022
build-all :
2123
name : Build all
22-
runs-on : macos-latest
24+
runs-on : workflow-kotlin-test-runner-ubuntu-4core
2325
steps :
2426
- uses : actions/checkout@v3
2527

@@ -30,7 +32,7 @@ jobs :
3032
write-cache-key : main-build-artifacts
3133

3234
dokka :
33-
name : Assemble & Dokka
35+
name : Dokka
3436
runs-on : ubuntu-latest
3537
needs : build-all
3638
steps :
@@ -44,7 +46,7 @@ jobs :
4446

4547
shards-and-version :
4648
name : Shard Matrix Yaml
47-
runs-on : ubuntu-latest
49+
runs-on : workflow-kotlin-test-runner-ubuntu-4core
4850
steps :
4951
- uses : actions/checkout@v3
5052

@@ -269,7 +271,7 @@ jobs :
269271

270272
performance-tests :
271273
name : Performance tests
272-
runs-on : macos-latest
274+
runs-on : workflow-kotlin-test-runner-ubuntu-4core
273275
timeout-minutes : 45
274276
strategy :
275277
# Allow tests to continue on other devices if they fail on one device.
@@ -290,7 +292,7 @@ jobs :
290292

291293
instrumentation-tests :
292294
name : Instrumentation tests
293-
runs-on : macos-latest
295+
runs-on : workflow-kotlin-test-runner-ubuntu-4core
294296
timeout-minutes : 60
295297
strategy :
296298
# Allow tests to continue on other devices if they fail on one device.
@@ -315,7 +317,7 @@ jobs :
315317

316318
runtime-instrumentation-tests :
317319
name : Conflate Stale Renderings Instrumentation tests
318-
runs-on : macos-latest
320+
runs-on : workflow-kotlin-test-runner-ubuntu-4core
319321
timeout-minutes : 60
320322
strategy :
321323
# Allow tests to continue on other devices if they fail on one device.

0 commit comments

Comments
 (0)