Skip to content

Commit

Permalink
Use Larger Runner Group for kotlin.yml Workflow
Browse files Browse the repository at this point in the history
Add KVM Permissions to Instrumentation Tests in order to use hardware acceleration for the Android emulator.
  • Loading branch information
steve-the-edwards committed Dec 20, 2023
1 parent 1699447 commit 3f8a8c2
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on :
push :
branches :
- main
pull_request :
pull_request_target :
branches :
- main
merge_group :

env:
Expand All @@ -16,10 +18,9 @@ concurrency :
cancel-in-progress : true

jobs :

build-all :
name : Build all
runs-on : macos-latest
runs-on : workflow-kotlin-test-runner-ubuntu-4core
steps :
- uses : actions/checkout@v3

Expand All @@ -30,7 +31,7 @@ jobs :
write-cache-key : main-build-artifacts

dokka :
name : Assemble & Dokka
name : Dokka
runs-on : ubuntu-latest
needs : build-all
steps :
Expand All @@ -44,7 +45,7 @@ jobs :

shards-and-version :
name : Shard Matrix Yaml
runs-on : ubuntu-latest
runs-on : workflow-kotlin-test-runner-ubuntu-4core
steps :
- uses : actions/checkout@v3

Expand Down Expand Up @@ -269,7 +270,7 @@ jobs :

performance-tests :
name : Performance tests
runs-on : macos-latest
runs-on : workflow-kotlin-test-runner-ubuntu-4core
timeout-minutes : 45
strategy :
# Allow tests to continue on other devices if they fail on one device.
Expand All @@ -290,7 +291,7 @@ jobs :

instrumentation-tests :
name : Instrumentation tests
runs-on : macos-latest
runs-on : workflow-kotlin-test-runner-ubuntu-4core
timeout-minutes : 60
strategy :
# Allow tests to continue on other devices if they fail on one device.
Expand All @@ -304,6 +305,13 @@ jobs :
steps :
- uses : actions/checkout@v3

# see https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name : Instrumented tests
uses : ./.github/actions/gradle-tasks-with-emulator
with :
Expand All @@ -315,7 +323,7 @@ jobs :

runtime-instrumentation-tests :
name : Conflate Stale Renderings Instrumentation tests
runs-on : macos-latest
runs-on : workflow-kotlin-test-runner-ubuntu-4core
timeout-minutes : 60
strategy :
# Allow tests to continue on other devices if they fail on one device.
Expand All @@ -330,6 +338,13 @@ jobs :
steps :
- uses : actions/checkout@v3

# see https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name : Instrumented tests
uses : ./.github/actions/gradle-tasks-with-emulator
with :
Expand Down

0 comments on commit 3f8a8c2

Please sign in to comment.