diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7147732458..fbb6d87c49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,46 +86,13 @@ jobs: - uses: gradle/gradle-build-action@v2 with: cache-read-only: ${{ env.MAIN_BRANCH != 'true' }} - - name: Pre build sources before launching emulator - run: ./gradlew compileDebugAndroidTestSources - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 - - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - # Use API 29 https://github.com/ReactiveCircus/android-emulator-runner/issues/222 - api-level: 29 - 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: Instrumentation tests - uses: reactivecircus/android-emulator-runner@v2 - with: - # Use API 29 https://github.com/ReactiveCircus/android-emulator-runner/issues/222 - api-level: 29 - arch: x86_64 - 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: | - adb logcat > logcat.out & - ./gradlew connectedCheck - - name: Managed device clean-up run: > - ./gradlew cleanManagedDevices --unused-only + adb logcat > logcat.out & ./gradlew cleanManagedDevices --unused-only && ./gradlew pixel2api30DebugAndroidTest -Dorg.gradle.workers.max=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info - name: Screenshot tests # Flags from https://github.com/android/nowinandroid/blob/main/.github/workflows/AndroidCIWithGmd.yaml run: > - ./gradlew screenshotTestsCompareBaseline + ./gradlew cleanManagedDevices --unused-only && ./gradlew screenshotTestsCompareBaseline -Dorg.gradle.workers.max=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true diff --git a/appyx-components/internal/test-drive/android/build.gradle.kts b/appyx-components/internal/test-drive/android/build.gradle.kts index 5faba0249f..55a066e13b 100644 --- a/appyx-components/internal/test-drive/android/build.gradle.kts +++ b/appyx-components/internal/test-drive/android/build.gradle.kts @@ -20,6 +20,15 @@ android { unitTests.all { it.useJUnitPlatform() } + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } } packagingOptions { resources.excludes.apply { diff --git a/appyx-components/stable/backstack/android/build.gradle.kts b/appyx-components/stable/backstack/android/build.gradle.kts index dff94790e0..898d489d63 100644 --- a/appyx-components/stable/backstack/android/build.gradle.kts +++ b/appyx-components/stable/backstack/android/build.gradle.kts @@ -19,6 +19,15 @@ android { unitTests.all { it.useJUnitPlatform() } + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } } packagingOptions { resources.excludes.apply { diff --git a/appyx-components/stable/spotlight/android/build.gradle.kts b/appyx-components/stable/spotlight/android/build.gradle.kts index 95d104c97f..0b6da101c7 100644 --- a/appyx-components/stable/spotlight/android/build.gradle.kts +++ b/appyx-components/stable/spotlight/android/build.gradle.kts @@ -20,6 +20,15 @@ android { unitTests.all { it.useJUnitPlatform() } + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } } packagingOptions { resources.excludes.apply { diff --git a/appyx-navigation/build.gradle.kts b/appyx-navigation/build.gradle.kts index 3f54886e3c..ce75613964 100644 --- a/appyx-navigation/build.gradle.kts +++ b/appyx-navigation/build.gradle.kts @@ -28,6 +28,15 @@ android { // interface method default implementation it.exclude("**/*\$DefaultImpls.class") } + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } } } diff --git a/demos/navigation-compose/build.gradle.kts b/demos/navigation-compose/build.gradle.kts index f63476019d..b8d7537d71 100644 --- a/demos/navigation-compose/build.gradle.kts +++ b/demos/navigation-compose/build.gradle.kts @@ -31,6 +31,17 @@ android { composeOptions { kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } + testOptions { + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } + } } dependencies { diff --git a/utils/interop-ribs/build.gradle.kts b/utils/interop-ribs/build.gradle.kts index 6cb026d26f..6073d4501b 100644 --- a/utils/interop-ribs/build.gradle.kts +++ b/utils/interop-ribs/build.gradle.kts @@ -27,6 +27,17 @@ android { composeOptions { kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } + testOptions { + managedDevices { + devices { + maybeCreate("pixel2api30").apply { + device = "Pixel 2" + apiLevel = 30 + systemImageSource = "aosp-atd" + } + } + } + } } dependencies {