chore(ci): Enable KVM #397
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: validate | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize] | |
concurrency: | |
# Limit concurrency to 1 for PRs. 'main' concurrency isn't limited. | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
api-level: [26, 31] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "adopt" | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
timeout-minutes: 5 | |
with: | |
# Only write to the cache for builds on the 'main' branches, stops branches evicting main cache | |
# Builds on other branches will only read from main branch cache writes | |
# Comment this and the with: above out for performance testing on a branch | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
# API 30+ emulators only have x86_64 system images. | |
- name: Get AVD info | |
uses: ./.github/actions/get-avd-info | |
id: avd-info | |
with: | |
api-level: ${{ matrix.api-level }} | |
- name: Enable KVM | |
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: Run Instrumented Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: ${{ steps.avd-info.outputs.arch }} | |
target: ${{ steps.avd-info.outputs.target }} | |
script: ./gradlew :kotlin-audio:connectedCheck | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() # always run even if the previous step fails | |
with: | |
report_paths: "kotlin-audio/build/outputs/androidTest-results/**/TEST-*.xml" | |
build-sample: | |
runs-on: blaze/macos-14 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "adopt" | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
timeout-minutes: 5 | |
with: | |
# Only write to the cache for builds on the 'main' branches, stops branches evicting main cache | |
# Builds on other branches will only read from main branch cache writes | |
# Comment this and the with: above out for performance testing on a branch | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
- name: Build Example App | |
run: ./gradlew :kotlin-audio-example:assembleDebug |