diff --git a/.github/actions/setup-host/action.yml b/.github/actions/setup-host/action.yml index 7959750..d63e438 100644 --- a/.github/actions/setup-host/action.yml +++ b/.github/actions/setup-host/action.yml @@ -20,7 +20,7 @@ runs: cache-encryption-key: ${{ inputs.gradle-encryption-key }} - name: Accept Android licences shell: bash - run: (yes || true) | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses + run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true - # https://developer.android.com/studio/test/gradle-managed-devices#create_a_gradle_managed_device name: Set `swiftshader_indirect` on Android Emulators (required by GHA) shell: bash diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1c2cdf7..8ae2182 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ permissions: jobs: build: name: Build - runs-on: macos-latest # to use Android emulator + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -26,8 +26,10 @@ jobs: uses: ./.github/actions/setup-host with: gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} + - run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list | grep 'system-images;android-34;google' + - run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager 'system-images;android-34;google_apis;x86_64' - name: Test & Build - run: ./gradlew -s build + run: ./gradlew -i :demo-project:ui-tests:emulatorSetup - name: Publish Test Report uses: gmazzo/publish-report-annotations@v1 if: always() diff --git a/demo-project/ui-tests/build.gradle.kts b/demo-project/ui-tests/build.gradle.kts index 678d178..7bc6d8f 100644 --- a/demo-project/ui-tests/build.gradle.kts +++ b/demo-project/ui-tests/build.gradle.kts @@ -25,15 +25,15 @@ android { } } -val pixel2 by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) { +val emulator by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) { device = "Pixel 6" - apiLevel = 30 - systemImageSource = "aosp-atd" + apiLevel = libs.versions.android.compileSDK.get().toInt() + systemImageSource = "google_apis" } baselineProfile { useConnectedDevices = false - managedDevices += pixel2.name + managedDevices += emulator.name } dependencies {