Skip to content

chore(deps): update Cocoa SDK to v8.10.0 #1304

chore(deps): update Cocoa SDK to v8.10.0

chore(deps): update Cocoa SDK to v8.10.0 #1304

name: Android Device Tests
on:
push:
branches:
- main
- release/*
pull_request:
jobs:
build:
runs-on: ubuntu-latest
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@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # Tag: 0.11.0
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set Java Version
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build Native Dependencies
uses: ./.github/actions/buildnative
- name: Install .NET Workloads
run: dotnet workload install maui-android --temp-dir "${{ runner.temp }}" --from-rollback-file rollback.json
- name: Restore .NET Dependencies
run: dotnet restore test/Sentry.Maui.Device.TestApp --nologo
- name: Build Android Test App
run: dotnet build test/Sentry.Maui.Device.TestApp -c Release -f net7.0-android --no-restore --nologo
- name: Upload Android Test App
uses: actions/upload-artifact@v3
with:
name: device-test-android
if-no-files-found: error
path: test/Sentry.Maui.Device.TestApp/bin/Release/net7.0-android/io.sentry.dotnet.maui.device.testapp-Signed.apk
android:
needs: [build]
name: Run Android API-${{ matrix.api-level }} Test
# Requires a "larger runner", for nested virtualization support
runs-on: ubuntu-latest-4-cores
strategy:
fail-fast: false
matrix:
api-level: [27, 28, 29, 30, 31] # emulators for API 32 and 33 are flaky - skip for now
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
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@v3
- name: Download test app artifact
uses: actions/download-artifact@v3
with:
name: device-test-android
path: bin
- name: Install XHarness
run: dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version "1.*-*"
- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # pin@v2
# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: ${{ runner.os }}-avd-api${{ matrix.api-level }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
target: ${{ matrix.api-level >= 32 && 'google_apis' || 'default' }}
force-avd-creation: false
ram-size: 2048M
arch: x86_64
disk-size: 4096M
emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run Tests
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
target: ${{ matrix.api-level >= 32 && 'google_apis' || 'default' }}
force-avd-creation: false
ram-size: 2048M
arch: x86_64
disk-size: 4096M
emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: xharness android test --output-directory=./test_output --app=bin/io.sentry.dotnet.maui.device.testapp-Signed.apk --package-name=io.sentry.dotnet.maui.device.testapp
- name: Create Test Report
if: success() || failure()
run: scripts/parse-xunit2-xml.ps1 ./test_output/TestResults.xml | Out-File $env:GITHUB_STEP_SUMMARY
shell: pwsh
- name: Upload results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: device-test-android-${{ matrix.api-level }}-results
path: test_output