Skip to content

Commit

Permalink
Test: Run tests on API 35 emulator with AOSP image
Browse files Browse the repository at this point in the history
Changes the emulator image for API 35 to AOSP and enables running tests on it in the CI workflow.
Additionally, sets `continue-on-error` to true for API 35 tests, and sets JAVA_VERSION to 21 in the CI environment.
  • Loading branch information
siarhei-luskanau committed Oct 28, 2024
1 parent 3d1705c commit e15edfd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Android build

on: [ push ]

env:
JAVA_VERSION: 21

jobs:

BuildAndTest:
Expand All @@ -17,7 +20,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
java-version: ${{ env.JAVA_VERSION }}
if: ${{ matrix.os != 'self-hosted' }}

- uses: gradle/actions/setup-gradle@v4
Expand All @@ -26,11 +29,21 @@ jobs:

Device:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
managed-virtual-device: [ 27, 28, 29, 30, 31, 32, 33, 34 ]
experimental: [ false ]
os: [ ubuntu-latest ]
include:
- managed-virtual-device: 35
experimental: true
os: ubuntu-latest
- managed-virtual-device: 35
experimental: true
os: macos-latest

steps:

- uses: actions/checkout@v4
Expand All @@ -45,14 +58,14 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
java-version: ${{ env.JAVA_VERSION }}
if: ${{ matrix.os != 'self-hosted' }}

- uses: gradle/actions/setup-gradle@v4

- run: ./gradlew ciSdkManagerLicenses --stacktrace

- run: ./gradlew managedVirtualDevice${{ matrix.managed-virtual-device }}DebugAndroidTest
-Pandroid.testInstrumentationRunnerArguments.class=siarhei.luskanau.managed.virtual.device.ExampleInstrumentedTest
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect
--stacktrace
-Pandroid.testInstrumentationRunnerArguments.class=siarhei.luskanau.managed.virtual.device.ExampleInstrumentedTest
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect
--stacktrace
3 changes: 1 addition & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ android {
device = "Nexus 4"
apiLevel = apiLevelIt
val systemImageConfig: Pair<String?, Boolean?> = when (apiLevel) {
30, 33, 34 -> "aosp" to true
35 -> "google" to null
30, 33, 34, 35 -> "aosp" to true
else -> null to null
}
systemImageConfig.first?.also { systemImageSource = it }
Expand Down

0 comments on commit e15edfd

Please sign in to comment.