diff --git a/.github/workflows/github-actions-concept.yml b/.github/workflows/github-actions-concept.yml new file mode 100644 index 0000000000000..9d1a23ee977f1 --- /dev/null +++ b/.github/workflows/github-actions-concept.yml @@ -0,0 +1,63 @@ +name: GitHub Actions Concept +run-name: Android instrumentation tests proof of concept +on: [push] + +jobs: + connected-tests: + runs-on: macos-latest + + strategy: + matrix: + api-level: [26, 28, 30, 33] + target: [google_apis] + arch: [x86_64] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'adopt' + cache: 'gradle' + + - name: Gradle Cache + uses: gradle/gradle-build-action@v2 + + - name: AVD Cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + - name: Create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: ReactiveCircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + working-directory: ./sdk/android + 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: Run connected tests + uses: ReactiveCircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: ${{ matrix.arch }} + working-directory: ./sdk/android + force-avd-creation: false + avd-name: android-samples-avd + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: ./gradlew connectedCheck +