From ff5d8f9e25949df55fac66b80c205d63bae5dac6 Mon Sep 17 00:00:00 2001 From: Brad Corso Date: Thu, 15 Aug 2024 14:09:50 -0700 Subject: [PATCH] Test emulator fix RELNOTES=N/A PiperOrigin-RevId: 663446807 --- .../actions/artifact-android-emulator-tests/action.yml | 10 ++++++++-- .github/workflows/ci.yml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/artifact-android-emulator-tests/action.yml b/.github/actions/artifact-android-emulator-tests/action.yml index 2fc298797df..aa81d80c286 100644 --- a/.github/actions/artifact-android-emulator-tests/action.yml +++ b/.github/actions/artifact-android-emulator-tests/action.yml @@ -25,16 +25,22 @@ runs: with: name: local-snapshot path: ~/.m2/repository/com/google/dagger - - name: 'Install Java ${{ env.USE_JAVA_VERSION }}' + # JDK 17+ is required for com.android.sdklib.tool.sdkmanager.SdkManagerCli + - name: 'Install Java ${{ env.USE_JAVA_VERSION_FOR_PLUGIN }}' uses: actions/setup-java@v3 with: distribution: '${{ env.USE_JAVA_DISTRIBUTION }}' - java-version: '${{ env.USE_JAVA_VERSION }}' + java-version: '${{ env.USE_JAVA_VERSION_FOR_PLUGIN }}' - name: 'Gradle Android emulator tests (API ${{ inputs.api-level }})' uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ inputs.api-level }} target: google_apis + 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 + avd-name: 'emulator-5554' script: ./util/run-local-emulator-tests.sh - name: 'Upload test reports (API ${{ inputs.api-level }})' if: ${{ always() }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10a608480af..2a4a814f609 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,7 @@ jobs: name: 'Artifact Android emulator tests (API ${{ matrix.api-level }})' # We only run this on master push (essentially a postsubmit) since these # can take a while to run - if: github.event_name == 'push' && github.repository == 'google/dagger' && github.ref == 'refs/heads/master' + # if: github.event_name == 'push' && github.repository == 'google/dagger' && github.ref == 'refs/heads/master' needs: bazel-build # It's recommended to run emulator tests on macOS # See https://github.com/marketplace/actions/android-emulator-runner