Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 5 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ on: [ push, pull_request ]

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
api-level: [ 21, 29 ]
target: [ default ]
arch: [ x86_64 ]
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
Expand All @@ -20,38 +16,7 @@ jobs:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew check
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- 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: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run checks
run: ./gradlew check
- name: Run integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck
run: ./gradlew ciDevicesDebugAndroidTest --info
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.useAndroidX=true
android.experimental.testOptions.managedDevices.allowOldApiLevelDevices=true

org.gradle.jvmargs=-Xmx1536m
39 changes: 39 additions & 0 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,45 @@ android {
storeFile = rootProject.file("debug.keystore")
}
}

testOptions {
val minSdk = libs.versions.minSdkSample.get().toInt()
val targetSdk = libs.versions.targetSdk.get().toInt()
managedDevices {
localDevices {
create("pixel2Api$minSdk") {
device = "Pixel 2"
apiLevel = minSdk
systemImageSource = "aosp"
}
create("pixel2Api$targetSdk") {
device = "Pixel 2"
apiLevel = targetSdk
systemImageSource = "aosp"
}
create("atdApi$minSdk") {
device = "Pixel 2"
apiLevel = minSdk
systemImageSource = "aosp-atd"
}
create("atdApi$targetSdk") {
device = "Pixel 2"
apiLevel = targetSdk
systemImageSource = "aosp-atd"
}
}
groups {
register("localDevices") {
targetDevices.add(allDevices.getByName("pixel2Api$minSdk"))
targetDevices.add(allDevices.getByName("pixel2Api$targetSdk"))
}
register("ciDevices") {
targetDevices.add(allDevices.getByName("atdApi$minSdk"))
targetDevices.add(allDevices.getByName("atdApi$targetSdk"))
}
}
}
}
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ git checkout -q "v${NEXT_VERSION}"
echo "Building the release..."
./gradlew clean build > /dev/null
echo "Running tests..."
./gradlew connectedCheck > /dev/null
./gradlew localDevicesDebugAndroidTest > /dev/null
echo "Uploading artifacts..."
./gradlew publishAggregationToCentralPortal > /dev/null

Expand Down
Loading