Skip to content

chore(ci): Enable KVM #387

chore(ci): Enable KVM

chore(ci): Enable KVM #387

Workflow file for this run

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
env:
JAVA_VERSION: 11
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
api-level: [22, 26, 31]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ env.JAVA_VERSION }}
- 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 Emulator 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: ${{ env.JAVA_VERSION }}
- 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