Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions .github/workflows/device-tests-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -64,6 +65,12 @@ jobs:
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
Expand All @@ -87,17 +94,33 @@ jobs:
# Cached AVD setup per https://github.com/ReactiveCircus/android-emulator-runner/blob/main/README.md

- name: Run Tests
id: first-run
continue-on-error: true
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # Tag: v2.34.0
with:
api-level: ${{ matrix.api-level }}
# We don't need the Google APIs, but the default images are not available for 32+
target: google_apis
target: ${{ env.ANDROID_EMULATOR_TARGET }}
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
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-run.outcome == 'failure'
timeout-minutes: 40
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # Tag: v2.34.0
with:
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 }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/device-tests-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:

jobs:
ios-tests:
Expand Down
4 changes: 2 additions & 2 deletions scripts/device-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ try
{
if (!(Get-Command xharness -ErrorAction SilentlyContinue))
{
Push-Location ($CI ? $env:RUNNER_TEMP : $IsWindows ? $env:TMP : $IsMacos ? $env:TMPDIR : '/temp')
dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version '10.0.0-prerelease.25412.1' `
Push-Location ($CI ? $env:RUNNER_TEMP : $IsWindows ? $env:TMP : $IsMacos ? $env:TMPDIR : '/tmp')
dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version '10.0.0-prerelease.25466.1' `
--add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json
Pop-Location
}
Expand Down
Loading