Skip to content

ci: Use Cirrus Runners for iOS integration tests#4951

Draft
Flash0ver wants to merge 26 commits intomainfrom
ci/cirrus-runners-for-integration-tests-on-mobile-devices
Draft

ci: Use Cirrus Runners for iOS integration tests#4951
Flash0ver wants to merge 26 commits intomainfrom
ci/cirrus-runners-for-integration-tests-on-mobile-devices

Conversation

@Flash0ver
Copy link
Member

@Flash0ver Flash0ver commented Feb 23, 2026

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:

  • 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 Integration Tests and Device Tests.

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>
@Flash0ver Flash0ver self-assigned this Feb 23, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Features ✨

  • feat: Network calls for Session Replay on Android by jamescrosswell in #4860

Fixes 🐛

  • fix: Log Warning instead of Error when ratelimited by bitsandfoxes in #4927

Dependencies ⬆️

Deps

  • chore(deps): update Cocoa SDK to v9.5.0 by github-actions in #4944
  • chore(deps): update Native SDK to v0.13.0 by github-actions in #4941
  • chore(deps): update CLI to v3.2.2 by github-actions in #4943
  • chore(deps): update Java SDK to v8.33.0 by github-actions in #4933
  • chore(deps): update CLI to v3.2.0 by github-actions in #4805
    • NOTE: Sentry CLI v3 removed support for the legacy API key authentication method. Sentry CLI now only supports authenticating with Auth Tokens. If you are using API key authentication via SentryApiKey, you need to generate an Auth Token and use SentryAuthToken, instead.
  • chore(deps): update Cocoa SDK to v9.4.1 by github-actions in #4928
  • chore(deps): update Native SDK to v0.12.8 by github-actions in #4929
  • Apps built using the Sentry SDK for .NET must now target iOS version 15 or higher. Previously only version 13 or higher was required. (#4781) by github-actions in #4781
  • Bump Cocoa SDK from v8.57.3 to v9.2.0 (#4781) by github-actions in #4781
  • chore(deps): update Native SDK to v0.12.7 by github-actions in #4920

Other

  • ci: Use Cirrus Runners for iOS integration tests by Flash0ver in #4951
  • test(blazor): Add Playwright E2E tests for navigation breadcrumbs by bruno-garcia in #4908
  • test(android): Use volatile to produce SIGSEGV in native crash test by jpnurmi in #4919

🤖 This preview updates automatically when you update the PR.

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.88%. Comparing base (815d9fb) to head (d4cf33f).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

matrix:
include:
- tfm: net10.0
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:12"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • changed to runner_group_id 10: 25b97b3
  • fixed image template version: 04a5b89
  • using Concurrency groups: 7f51356

Flash0ver and others added 7 commits February 24, 2026 21:21
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>
}

[Fact]
public void This_Test_Should_Fail()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: remove

I added this to see a test failure in CI ... to double check against a false negative

Comment on lines +92 to +97
- 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd throw it away. This just helped to debug why tests refused to run on iossimulator-x64 (no x64 runtime available).

Comment on lines +18 to +25
$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" }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Refactor

Is there a "nicer" way to describe this test matrix?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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... 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image image

<!-- 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>
Copy link
Member Author

@Flash0ver Flash0ver Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

<LatestIosTfm>net10.0-ios26</LatestIosTfm>
<PreviousIosTfm>net9.0-ios18.0</PreviousIosTfm>

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?

@Flash0ver Flash0ver marked this pull request as ready for review March 2, 2026 12:15
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

Copy link
Member Author

@Flash0ver Flash0ver Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed via ba35dc4 by accepting an optional xcode-version input

@Flash0ver Flash0ver marked this pull request as draft March 2, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: use Cirrus Runners for iOS Integration Tests Bring back iOS / MAUI 9.0 integration/device tests

3 participants