From e15edfdea1569c3da0596c92d06cd21dcb795268 Mon Sep 17 00:00:00 2001 From: Siarhei Luskanau Date: Mon, 28 Oct 2024 12:41:38 +0100 Subject: [PATCH] Test: Run tests on API 35 emulator with AOSP image 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. --- .github/workflows/android_build.yml | 25 +++++++++++++++++++------ app/build.gradle.kts | 3 +-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 81ed323..f106577 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -2,6 +2,9 @@ name: Android build on: [ push ] +env: + JAVA_VERSION: 21 + jobs: BuildAndTest: @@ -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 @@ -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 @@ -45,7 +58,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 @@ -53,6 +66,6 @@ jobs: - 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 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 35a3ced..07e54c4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -64,8 +64,7 @@ android { device = "Nexus 4" apiLevel = apiLevelIt val systemImageConfig: Pair = 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 }