From ddf0b779fec1b4dec3f8c13145f00c8e19732dbd 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 | 4 ++-- 2 files changed, 10 insertions(+), 4 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..55dc7a81063 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,14 +84,14 @@ 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 runs-on: macos-latest strategy: matrix: # Run on 16 (PreL), 21 (L), and 26 (O). - api-level: [16, 21, 26, 30] + api-level: [21, 26, 30] steps: - uses: actions/checkout@v3 - uses: ./.github/actions/artifact-android-emulator-tests