|
name: AGP Matrix Compatibility |
|
|
|
on: |
|
push: |
|
branches: |
|
- main |
|
pull_request: |
|
|
|
concurrency: |
|
group: ${{ github.workflow }}-${{ github.ref }} |
|
cancel-in-progress: true |
|
|
|
jobs: |
|
agp-matrix-compatibility: |
|
timeout-minutes: 30 |
|
runs-on: ubuntu-latest |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
agp: [ '9.0.0', '9.2.1', '9.4.0' ] |
|
integrations: [ true, false ] |
|
|
|
name: AGP Matrix Release - AGP ${{ matrix.agp }} - Integrations ${{ matrix.integrations }} |
|
env: |
|
VERSION_AGP: ${{ matrix.agp }} |
|
APPLY_SENTRY_INTEGRATIONS: ${{ matrix.integrations }} |
|
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} |
|
|
|
steps: |
|
- name: Checkout Repo |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
submodules: 'recursive' |
|
|
|
- name: Setup Java Version |
|
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 |
|
with: |
|
distribution: 'temurin' |
|
java-version: '17' |
|
|
|
- name: Setup Gradle |
|
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 |
|
with: |
|
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} |
|
|
|
- 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: AVD cache |
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
|
id: avd-cache |
|
with: |
|
path: | |
|
~/.android/avd/* |
|
~/.android/adb* |
|
key: avd-api-30-x86_64-aosp_atd |
|
|
|
- name: Create AVD and generate snapshot for caching |
|
if: steps.avd-cache.outputs.cache-hit != 'true' |
|
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # pin@v2 |
|
with: |
|
api-level: 30 |
|
target: aosp_atd |
|
channel: canary # Necessary for ATDs |
|
arch: x86_64 |
|
force-avd-creation: false |
|
disable-animations: true |
|
disable-spellchecker: true |
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
|
disk-size: 4096M |
|
script: echo "Generated AVD snapshot for caching." |
|
|
|
# Clean, build and release a test apk |
|
- name: Make assembleUiTests |
|
run: make assembleUiTests |
|
|
|
# We tried to use the cache action to cache gradle stuff, but it made tests slower and timeout |
|
- name: Run instrumentation tests |
|
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # pin@v2 |
|
with: |
|
api-level: 30 |
|
target: aosp_atd |
|
channel: canary # Necessary for ATDs |
|
arch: x86_64 |
|
force-avd-creation: false |
|
disable-animations: true |
|
disable-spellchecker: true |
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none |
|
disk-size: 4096M |
|
script: ./gradlew sentry-android-integration-tests:sentry-uitest-android:connectedReleaseAndroidTest -Denvironment=github --daemon |
|
|
|
- name: Upload test results |
|
if: always() |
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
|
with: |
|
name: test-results-AGP${{ matrix.agp }}-Integrations${{ matrix.integrations }} |
|
path: | |
|
**/build/reports/* |
|
**/build/outputs/*/connected/* |
|
**/build/outputs/mapping/release/* |
|
|
|
- name: Test Report |
|
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16 |
|
if: always() |
|
with: |
|
name: JUnit AGP ${{ matrix.agp }} - Integrations ${{ matrix.integrations }} |
|
path: | |
|
**/build/outputs/androidTest-results/**/*.xml |
|
reporter: java-junit |
|
output-to: step-summary |
|
fail-on-error: false |