Skip to content

SentryGraphQLHttpFailedRequestHandler improved issue grouping. #7669

SentryGraphQLHttpFailedRequestHandler improved issue grouping.

SentryGraphQLHttpFailedRequestHandler improved issue grouping. #7669

name: Android Device Tests
on:
push:
branches:
- main
- release/*
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
build:
name: Build (${{ matrix.tfm }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tfm: [net9.0]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
steps:
- name: Cancel Previous Runs
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: recursive
- name: Setup Environment
uses: ./.github/actions/environment
- name: Build Native Dependencies
uses: ./.github/actions/buildnative
- name: Build Android Test App
run: pwsh ./scripts/device-test.ps1 android -Build -Tfm ${{ matrix.tfm }}
- name: Upload Android Test App (net9.0)
if: matrix.tfm == 'net9.0'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-android-net9.0
if-no-files-found: error
path: test/Sentry.Maui.Device.TestApp/bin/Release/net9.0-android/android-x64/io.sentry.dotnet.maui.device.testapp-Signed.apk
android:
needs: [build]
name: Run Android API-${{ matrix.api-level }} Test (${{ matrix.tfm }})
# Requires a "larger runner", for nested virtualization support
runs-on: ubuntu-latest-4-cores
strategy:
fail-fast: false
matrix:
tfm: [net9.0]
# Must be 34+ for new apps and app updates as of August 31, 2024.
# See https://apilevels.com/
api-level: [34, 36]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
# We don't need the Google APIs, but the default images are not available for 32+
ANDROID_EMULATOR_TARGET: google_apis
ANDROID_EMULATOR_RAM_SIZE: 2048M
ANDROID_EMULATOR_ARCH: x86_64
ANDROID_EMULATOR_DISK_SIZE: 4096M
ANDROID_EMULATOR_OPTIONS: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
steps:
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
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: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
submodules: recursive
- name: Download test app artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: device-test-android-${{ matrix.tfm }}
path: bin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
- name: Run Tests
id: first-test-run
continue-on-error: true
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with: &android-emulator-test
api-level: ${{ matrix.api-level }}
target: ${{ env.ANDROID_EMULATOR_TARGET }}
force-avd-creation: false
ram-size: ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
arch: ${{ env.ANDROID_EMULATOR_ARCH }}
disk-size: ${{ env.ANDROID_EMULATOR_DISK_SIZE }}
emulator-options: ${{ env.ANDROID_EMULATOR_OPTIONS }}
disable-animations: false
script: pwsh scripts/device-test.ps1 android -Run -Tfm ${{ matrix.tfm }}
- name: Retry Tests (if previous failed to run)
if: steps.first-test-run.outcome == 'failure'
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with: *android-emulator-test
- name: Setup Environment
uses: ./.github/actions/environment
- name: Select Java 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: ${{ runner.os == 'Windows' && runner.arch == 'ARM64' && 'microsoft' || 'temurin' }}
java-version: '17'
- name: Checkout github-workflows
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: getsentry/github-workflows
ref: a5e409bd5bad4c295201cdcfe862b17c50b29ab7 # v2.14.1
path: modules/github-workflows
- name: Run Integration Tests
id: first-integration-test-run
continue-on-error: true
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with: &android-emulator-integration-test
api-level: ${{ matrix.api-level }}
target: ${{ env.ANDROID_EMULATOR_TARGET }}
force-avd-creation: false
ram-size: ${{ env.ANDROID_EMULATOR_RAM_SIZE }}
arch: ${{ env.ANDROID_EMULATOR_ARCH }}
disk-size: ${{ env.ANDROID_EMULATOR_DISK_SIZE }}
emulator-options: ${{ env.ANDROID_EMULATOR_OPTIONS }}
disable-animations: false
script: pwsh integration-test/android.Tests.ps1
- name: Retry Integration Tests (if previous failed to run)
if: steps.first-integration-test-run.outcome == 'failure'
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with: *android-emulator-integration-test
- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: device-test-android-${{ matrix.api-level }}-${{ matrix.tfm }}-results
path: |
test_output
integration-test/mobile-app/test_output