diff --git a/.github/workflows/device-tests-ios.yml b/.github/workflows/device-tests-ios.yml index c4f191a8a6..1de381232c 100644 --- a/.github/workflows/device-tests-ios.yml +++ b/.github/workflows/device-tests-ios.yml @@ -52,7 +52,18 @@ on: jobs: ios-tests: - runs-on: macos-15 + name: iOS Tests (${{ matrix.tfm }}) + strategy: + fail-fast: false + matrix: + include: + - tfm: net9.0 + xcode: "26.0.1" + runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.0.1,runner_concurrency_group=${{ github.run_id }}", "runner_group_id:10"] + - tfm: net10.0 + xcode: "26.2" + runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2,runner_concurrency_group=${{ github.run_id }}", "runner_group_id:10"] + runs-on: ${{ matrix.runs-on }} env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: 1 @@ -71,40 +82,57 @@ jobs: - name: Setup Environment uses: ./.github/actions/environment + - name: Install PowerShell + run: | + which pwsh || (dotnet tool install --global PowerShell && echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH") + + - name: Select Xcode + run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app + + - name: Check Rosetta + run: | + arch -x86_64 /usr/bin/true && echo "Rosetta: yes" || echo "Rosetta: no" + + - name: List Simulator Runtimes + run: xcrun simctl list runtimes -j + - name: Build iOS Test App - run: pwsh ./scripts/device-test.ps1 ios -Build + run: pwsh ./scripts/device-test.ps1 ios -Build -Tfm ${{ matrix.tfm }} - name: Run Tests id: first-test-run continue-on-error: true timeout-minutes: 40 - run: pwsh scripts/device-test.ps1 ios -Run + run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }} - name: Retry Tests (if previous failed to run) if: steps.first-test-run.outcome == 'failure' timeout-minutes: 40 - run: pwsh scripts/device-test.ps1 ios -Run + run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }} + + - name: Checkout github-workflows + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + repository: getsentry/github-workflows + ref: 747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1 + path: modules/github-workflows - name: Run Integration Tests id: first-integration-test-run continue-on-error: true timeout-minutes: 40 - uses: getsentry/github-workflows/sentry-cli/integration-test@747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1 - with: - path: integration-test/ios.Tests.ps1 + run: pwsh integration-test/ios.Tests.ps1 -dotnet_version ${{ matrix.tfm }} - name: Retry Integration Tests (if previous failed to run) if: steps.first-integration-test-run.outcome == 'failure' timeout-minutes: 40 - uses: getsentry/github-workflows/sentry-cli/integration-test@747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1 - with: - path: integration-test/ios.Tests.ps1 + run: pwsh integration-test/ios.Tests.ps1 -dotnet_version ${{ matrix.tfm }} - name: Upload results if: success() || failure() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: - name: device-test-ios-results + name: device-test-ios-results-${{ matrix.tfm }} path: | test_output integration-test/mobile-app/test_output diff --git a/integration-test/ios.Tests.ps1 b/integration-test/ios.Tests.ps1 index 3c38696f69..846d101059 100644 --- a/integration-test/ios.Tests.ps1 +++ b/integration-test/ios.Tests.ps1 @@ -1,3 +1,7 @@ +param( + [string] $dotnet_version = "net10.0" +) + # This file contains test cases for https://pester.dev/ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' @@ -11,12 +15,14 @@ BeforeDiscovery { $script:simulator = Get-IosSimulatorUdid -PreferredStates @('Booted') } +$ios_tpv = switch ($dotnet_version) { + 'net9.0' { '26.0' } + default { '26.2' } +} + Describe 'iOS app (, )' -ForEach @( - # Note: we can't run against net10 and net9 becaus .NET 10 requires Xcode 26.2 and .NET 9 requires Xcode 26.0. - # The macOS GitHub Actions runners only have Xcode 26.1+ installed and no support for Xcode 26.2 is planned for - # net9.0-ios: https://github.com/dotnet/macios/issues/24199#issuecomment-3819021247 - @{ tfm = "net10.0-ios26.2"; configuration = "Release" } - @{ tfm = "net10.0-ios26.2"; configuration = "Debug" } + @{ tfm = "$dotnet_version-ios$ios_tpv"; configuration = "Release" } + @{ tfm = "$dotnet_version-ios$ios_tpv"; configuration = "Debug" } ) -Skip:(-not $script:simulator) { BeforeAll { . $PSScriptRoot/../scripts/device-test-utils.ps1 diff --git a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj index b609446eba..ee5f847389 100644 --- a/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj +++ b/integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj @@ -5,7 +5,7 @@ - $(TargetFrameworks);net10.0-ios26.2 + $(TargetFrameworks);net9.0-ios26.0;net10.0-ios26.2 Exe Sentry.Maui.Device.IntegrationTestApp diff --git a/scripts/device-test-utils.ps1 b/scripts/device-test-utils.ps1 index 455e85e4e8..e6fedaeb67 100644 --- a/scripts/device-test-utils.ps1 +++ b/scripts/device-test-utils.ps1 @@ -4,7 +4,7 @@ function Install-XHarness { $CI = Test-Path env:CI 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' ` + dotnet tool install Microsoft.DotNet.XHarness.CLI --global --version '10.0.0-prerelease.25622.2' ` --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json Pop-Location } diff --git a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj index 602e09d06b..5af7733703 100644 --- a/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj +++ b/test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj @@ -2,11 +2,7 @@ $(TargetFrameworks);net9.0-android;net10.0-android - - $(TargetFrameworks);net10.0-ios + $(TargetFrameworks);net9.0-ios;net10.0-ios $(DefineConstants);VISUAL_RUNNER @@ -38,7 +34,8 @@ 21.0 - 26.2 + 26.2 + 26.0 true