ci: Use Cirrus Runners for iOS integration tests#4951
ci: Use Cirrus Runners for iOS integration tests#4951
Conversation
Switch the iOS device tests workflow from GitHub-hosted macOS runners to Cirrus Labs runners. GitHub-hosted runners keep removing older Xcode versions, which breaks CI. Cirrus Labs runners provide stable, pinned Xcode environments. Two separate matrix entries run on dedicated Cirrus images: - net10.0 on ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0 (Xcode 26.2) - net9.0 on ghcr.io/cirruslabs/macos-tahoe-xcode:26.0.1 (Xcode 26.0) Re-enable net9.0-ios targets in both csproj files (disabled in #4750 pending this fix) and make ios.Tests.ps1 parameterizable via -dotnet_version, consistent with android.Tests.ps1. Fixes GH-4895 Co-Authored-By: Claude <noreply@anthropic.com>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features ✨
Fixes 🐛
Dependencies ⬆️Deps
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4951 +/- ##
==========================================
- Coverage 73.89% 73.88% -0.02%
==========================================
Files 496 496
Lines 17951 17951
Branches 3516 3516
==========================================
- Hits 13265 13263 -2
- Misses 3825 3826 +1
- Partials 861 862 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| matrix: | ||
| include: | ||
| - tfm: net10.0 | ||
| runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:12"] |
There was a problem hiding this comment.
Looks like these never triggered, I am not sure about the reason.
The tag might be wrong, it should be just 26.2 (see https://github.com/cirruslabs/macos-image-templates/pkgs/container/macos-tahoe-xcode/676398842?tag=26.2)
But I can suggest adding this to ensure they execute in FIFO: https://cirrus-runners.app/setup/#concurrency-groups-fifo-scheduling
Co-authored-by: Itay Brenner <itaybrenner@hotmail.com>
Put net9.0 before net10.0 in the matrix and update the net10.0 Xcode image tag from 26.2.0 to 26.2 to match the available Cirrus image name. Co-Authored-By: Claude <noreply@anthropic.com>
Append runner_concurrency_group=${{ github.run_id }} to the image label
for each matrix entry. This ensures a runner provisioned for a given
workflow run is not claimed by a different run, enabling FIFO scheduling
and avoiding unnecessary queuing when the runner group reaches capacity.
Co-Authored-By: Claude <noreply@anthropic.com>
Cirrus macos-tahoe-xcode images do not have pwsh pre-installed. Install it as a .NET global tool (which is already available from the Setup Environment step) when pwsh is not found on PATH. Co-Authored-By: Claude <noreply@anthropic.com>
After installing PowerShell as a dotnet global tool, append $HOME/.dotnet/tools to $GITHUB_PATH so pwsh is available in all subsequent steps. Co-Authored-By: Claude <noreply@anthropic.com>
Bump the XHarness CLI prerelease version to pick up the latest fixes. Co-Authored-By: Claude <noreply@anthropic.com>
The Cirrus runner image for net9.0 (macos-tahoe-xcode:26.0.1) has Xcode 26.2 selected as the default, even though Xcode 26.0.1 is also installed. The .NET iOS 26.0 SDK requires exactly Xcode 26.0, so the build fails with a version mismatch error. Add an explicit xcode-select step before the build, using a new xcode matrix field to set the correct Xcode path for each TFM. Co-Authored-By: Claude <noreply@anthropic.com>
test/Sentry.Tests/SentrySdkTests.cs
Outdated
| } | ||
|
|
||
| [Fact] | ||
| public void This_Test_Should_Fail() |
There was a problem hiding this comment.
todo: remove
I added this to see a test failure in CI ... to double check against a false negative
Co-Authored-By: J-P Nurmi <jp@jpnurmi.dev>
| - 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 |
There was a problem hiding this comment.
question: Debug Info
Should we remove these two steps again, as we added them for debugging?
Or could at least the 2nd one be generally helpful?
Or maybe make them conditional when "debug logging" is enabled in CI?
There was a problem hiding this comment.
I'd throw it away. This just helped to debug why tests refused to run on iossimulator-x64 (no x64 runtime available).
integration-test/ios.Tests.ps1
Outdated
| $ios_tpv = switch ($dotnet_version) { | ||
| 'net9.0' { '26.0' } | ||
| default { '26.2' } | ||
| } | ||
|
|
||
| Describe 'iOS app (<tfm>, <configuration>)' -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" } |
There was a problem hiding this comment.
question: Refactor
Is there a "nicer" way to describe this test matrix?
There was a problem hiding this comment.
If we can somehow make it work, I'd prefer a simple static matrix:
@{ tfm = "net9.0-ios26.0"; configuration = "Release" }
@{ tfm = "net9.0-ios26.0"; configuration = "Debug" }
@{ tfm = "net10.0-ios26.2"; configuration = "Release" }
@{ tfm = "net10.0-ios26.2"; configuration = "Debug" }and then somehow filter what we run from the CI. I'm not sure how to do that with Pwsh/Pester from the command line, but the Pester extension for VS Code is able to run specific matrix configurations, so it should be somehow possible... 🤔
| <!-- Pin target iOS version to the Xcode version of the respective CI runner image. | ||
| 'netX.0-ios' resolves the latest version of the iOS SDK otherwise. --> | ||
| <TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">26.2</TargetPlatformVersion> | ||
| <TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(TargetFramework)' == 'net9.0-ios'">26.0</TargetPlatformVersion> |
There was a problem hiding this comment.
question: iOS 26 & Xcode 26 vs iOS 18 & Xcode 16
.NET 9 supports up to Xcode 26.0.
Should we use that version ... or "our lowest" (ios18.0) version instead ... see:
sentry-dotnet/Directory.Build.props
Lines 34 to 35 in 815d9fb
Where we would need to - likewise - change the CI runner to Xcode 16.4.
Which was actually the original status before updating the Integration Tests to .NET 10:
https://github.com/getsentry/sentry-dotnet/pull/4750/changes#r2771172008
Or is it better to actually test against the latest (last) supported version for .NET MAUI 9.0?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| id: first-test-run | ||
| continue-on-error: true | ||
| timeout-minutes: 40 | ||
| run: pwsh scripts/device-test.ps1 ios -Run -Verbose |
There was a problem hiding this comment.
Environment action hardcodes Xcode 26.2 breaking net9.0 runner
High Severity
The Setup Environment step (using .github/actions/environment) runs before the Select Xcode step. The environment action hardcodes sudo xcode-select --switch /Applications/Xcode_26.2.app for all macOS runners. On the net9.0 Cirrus image (macos-tahoe-xcode:26.0.1), Xcode 26.2 is not installed — only 26.0.1 is available. This causes the environment setup to fail before the matrix-aware Select Xcode step gets a chance to set the correct version, completely blocking the net9.0 job.
Additional Locations (1)
There was a problem hiding this comment.
fixed via ba35dc4 by accepting an optional xcode-version input




Resolves #4895
Resolves #4950
Depends on #4961
Switch the iOS device tests workflow from GitHub-hosted macOS runners to Cirrus Labs runners. GitHub-hosted runners keep removing older Xcode versions, which breaks CI. Cirrus Labs runners provide stable, pinned Xcode environments.
Two separate matrix entries run on dedicated Cirrus images:
Re-enable net9.0-ios targets in both Integration Tests and Device Tests.