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
2 changes: 1 addition & 1 deletion .github/workflows/merge-queue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
if: github.repository == 'meshtastic/Meshtastic-Android'
uses: ./.github/workflows/reusable-android-test.yml
with:
api_levels: '[26, 35]' # Run on both API 26 and 35 for merge queue
api_levels: '[32, 35]' # Run on both API 32 and 35 for merge queue
upload_artifacts: false
secrets:
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/reusable-android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
type: boolean
default: true
api_levels:
description: 'JSON array string of API levels to run tests on (e.g., `[35]` or `[26, 35]`)'
description: 'JSON array string of API levels to run tests on (e.g., `[35]` or `[32, 35]`)'
required: false
type: string
default: '[26, 35]' # Default to running both if not specified by caller
default: '[32, 35]' # Default to running both if not specified by caller
secrets:
GRADLE_ENCRYPTION_KEY:
required: false
Expand Down Expand Up @@ -55,6 +55,26 @@ jobs:
build-scan-terms-of-use-agree: 'yes'
add-job-summary: always

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- 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 }}
arch: x86_64
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 Android Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
env:
Expand All @@ -63,9 +83,10 @@ jobs:
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-metrics -camera-back none
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :app:connectedFdroidDebugAndroidTest :app:connectedGoogleDebugAndroidTest --configuration-cache --scan && ( killall -INT crashpad_handler || true )

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,27 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinBaseExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties

/**
* Configure base Kotlin with Android options
*/
internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
val configPropertiesFile = rootProject.file("config.properties")
val configProperties = Properties()

if (configPropertiesFile.exists()) {
FileInputStream(configPropertiesFile).use { configProperties.load(it) }
}

commonExtension.apply {
compileSdk = 36
compileSdk = configProperties.get("COMPILE_SDK").toString().toInt()

defaultConfig {
minSdk = 26
minSdk = configProperties.get("MIN_SDK").toString().toInt()
}

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ VERSION_CODE_OFFSET=29314197

# Application and SDK versions
APPLICATION_ID=com.geeksville.mesh
MIN_SDK=26
MIN_SDK=32
TARGET_SDK=36
COMPILE_SDK=36

Expand Down