Skip to content

Commit

Permalink
Merge pull request #994 from yschimke/kvm
Browse files Browse the repository at this point in the history
Run on faster ubuntu runners
  • Loading branch information
yschimke authored Jan 29, 2024
2 parents 1f0c80e + 1a79eec commit 8af138c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 27 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/AlwaysOnKotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,46 +66,49 @@ jobs:
path: ${{ env.SAMPLE_PATH }}/compose/build/reports

android-test:
runs-on: macos-latest # enables hardware acceleration in the virtual machine
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
device:
- roundApi28
- roundApi30
- roundApi33
- 28
- 30
- 33

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install pulseaudio
run: brew install pulseaudio
- name: Bump to AGP 8.4 alpha
run: |
sed -i 's/android-gradle-plugin = .*/android-gradle-plugin = "8.4.0-alpha04"/' ${{ env.SAMPLE_PATH }}/gradle/libs.versions.toml
sed -r -i 's/\/\/(\s+id "com.google.firebase.testlab")/\1/' ${{ env.SAMPLE_PATH }}/compose/build.gradle
- 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: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Install Emulator
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --install "emulator"

- name: Accept licenses
run: |
mkdir -p /Users/runner/Library/Android/sdk/licenses
echo 84831b9409646a918e30573bab4c9c91346d8abd > /Users/runner/Library/Android/sdk/licenses/android-sdk-preview-license
mkdir -p /usr/local/lib/android/sdk/licenses
echo 84831b9409646a918e30573bab4c9c91346d8abd > /usr/local/lib/android/sdk/licenses/android-sdk-preview-license
- name: Run instrumentation tests
uses: gradle/gradle-build-action@v2
with:
arguments: ${{ matrix.device }}Check
-Dorg.gradle.workers.max=1
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=180
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=false
--stacktrace
--info
arguments: roundApi${{ matrix.device }}Check
build-root-directory: ${{ env.SAMPLE_PATH }}

- name: Upload views test reports
Expand Down
19 changes: 10 additions & 9 deletions AlwaysOnKotlin/compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ android {
}

testOptions {
//
// firebaseTestLab {
// managedDevices {
// pixelWatch {
// device = "r11"
// apiLevel = 30
// }
// }
// }
if (pluginManager.hasPlugin("com.google.firebase.testlab")) {
firebaseTestLab {
managedDevices {
pixelWatch {
device = "r11"
apiLevel = 30
}
}
}
}
devices {
squareApi30(ManagedVirtualDevice) {
device = "Wear OS Square"
Expand Down
5 changes: 4 additions & 1 deletion AlwaysOnKotlin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ android.enableJetifier=true
android.useAndroidX=true
android.sdk.channel=3
# https://buganizer.corp.google.com/issues/311218673
android.experimental.lint.version=8.3.0-alpha14
android.experimental.lint.version=8.4.0-alpha04
android.experimental.testOptions.managedDevices.customDevice=true
android.experimental.testOptions.managedDevices.maxConcurrentDevices=1
android.experimental.testOptions.managedDevices.setupTimeoutMinutes=180
android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect

0 comments on commit 8af138c

Please sign in to comment.