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 d4450b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/actions/gradle-tasks-with-emulator/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ runs :
using : 'composite'
steps :

# Setup the runner in the KVM group to enable HW Accleration for the emulator.
# 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
# Create or fetch the artifacts used for these tests.
- name : Run ${{ inputs.prepare-task }}
uses : ./.github/actions/gradle-task
Expand Down
16 changes: 9 additions & 7 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 @@ -19,7 +21,7 @@ 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 +32,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 +46,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 +271,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 +292,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 @@ -315,7 +317,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 Down

0 comments on commit d4450b6

Please sign in to comment.