diff --git a/.github/workflows/instrumentation_tests.yml b/.github/workflows/instrumentation_tests.yml new file mode 100644 index 00000000..1c5d2d9a --- /dev/null +++ b/.github/workflows/instrumentation_tests.yml @@ -0,0 +1,46 @@ +name: Instrumentation tests +on: [pull_request, workflow_dispatch] +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + api-level: [ 31, 35 ] + target: [ default, google_apis ] + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: run tests + id: run_tests + uses: reactivecircus/android-emulator-runner@v2 + continue-on-error: true + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: x86_64 + profile: pixel_7_pro + script: | + adb shell 'echo "_ --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line' + adb shell chmod 777 /data/local/tmp/chrome-command-line + ./gradlew :demo:connectedCheck --stacktrace + + - name: retry tests + if: steps.run_tests.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: x86_64 + profile: pixel_7_pro + script: | + adb shell 'echo "_ --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line' + adb shell chmod 777 /data/local/tmp/chrome-command-line + ./gradlew :demo:connectedCheck --stacktrace