Skip to content

Commit 1df212b

Browse files
Flash0verclaude
andcommitted
ci: Use Cirrus Runners for iOS integration 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>
1 parent d412e08 commit 1df212b

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

.github/workflows/device-tests-ios.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ on:
5252

5353
jobs:
5454
ios-tests:
55-
runs-on: macos-15
55+
name: iOS Tests (${{ matrix.tfm }})
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
include:
60+
- tfm: net10.0
61+
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.2.0", "runner_group_id:12"]
62+
- tfm: net9.0
63+
runs-on: ["ghcr.io/cirruslabs/macos-tahoe-xcode:26.0.1", "runner_group_id:12"]
64+
runs-on: ${{ matrix.runs-on }}
5665
env:
5766
DOTNET_CLI_TELEMETRY_OPTOUT: 1
5867
DOTNET_NOLOGO: 1
@@ -72,39 +81,42 @@ jobs:
7281
uses: ./.github/actions/environment
7382

7483
- name: Build iOS Test App
75-
run: pwsh ./scripts/device-test.ps1 ios -Build
84+
run: pwsh ./scripts/device-test.ps1 ios -Build -Tfm ${{ matrix.tfm }}
7685

7786
- name: Run Tests
7887
id: first-test-run
7988
continue-on-error: true
8089
timeout-minutes: 40
81-
run: pwsh scripts/device-test.ps1 ios -Run
90+
run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }}
8291

8392
- name: Retry Tests (if previous failed to run)
8493
if: steps.first-test-run.outcome == 'failure'
8594
timeout-minutes: 40
86-
run: pwsh scripts/device-test.ps1 ios -Run
95+
run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }}
96+
97+
- name: Checkout github-workflows
98+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99+
with:
100+
repository: getsentry/github-workflows
101+
ref: 747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1
102+
path: modules/github-workflows
87103

88104
- name: Run Integration Tests
89105
id: first-integration-test-run
90106
continue-on-error: true
91107
timeout-minutes: 40
92-
uses: getsentry/github-workflows/sentry-cli/integration-test@747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1
93-
with:
94-
path: integration-test/ios.Tests.ps1
108+
run: pwsh integration-test/ios.Tests.ps1 -dotnet_version ${{ matrix.tfm }}
95109

96110
- name: Retry Integration Tests (if previous failed to run)
97111
if: steps.first-integration-test-run.outcome == 'failure'
98112
timeout-minutes: 40
99-
uses: getsentry/github-workflows/sentry-cli/integration-test@747c4c2906d373f5cd809abe94a7fd732a2421a7 # 3.2.1
100-
with:
101-
path: integration-test/ios.Tests.ps1
113+
run: pwsh integration-test/ios.Tests.ps1 -dotnet_version ${{ matrix.tfm }}
102114

103115
- name: Upload results
104116
if: success() || failure()
105117
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
106118
with:
107-
name: device-test-ios-results
119+
name: device-test-ios-results-${{ matrix.tfm }}
108120
path: |
109121
test_output
110122
integration-test/mobile-app/test_output

integration-test/ios.Tests.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
param(
2+
[string] $dotnet_version = "net10.0"
3+
)
4+
15
# This file contains test cases for https://pester.dev/
26
Set-StrictMode -Version Latest
37
$ErrorActionPreference = 'Stop'
@@ -11,12 +15,14 @@ BeforeDiscovery {
1115
$script:simulator = Get-IosSimulatorUdid -PreferredStates @('Booted')
1216
}
1317

18+
$ios_tpv = switch ($dotnet_version) {
19+
'net9.0' { '26.0' }
20+
default { '26.2' }
21+
}
22+
1423
Describe 'iOS app (<tfm>, <configuration>)' -ForEach @(
15-
# Note: we can't run against net10 and net9 becaus .NET 10 requires Xcode 26.2 and .NET 9 requires Xcode 26.0.
16-
# The macOS GitHub Actions runners only have Xcode 26.1+ installed and no support for Xcode 26.2 is planned for
17-
# net9.0-ios: https://github.com/dotnet/macios/issues/24199#issuecomment-3819021247
18-
@{ tfm = "net10.0-ios26.2"; configuration = "Release" }
19-
@{ tfm = "net10.0-ios26.2"; configuration = "Debug" }
24+
@{ tfm = "$dotnet_version-ios$ios_tpv"; configuration = "Release" }
25+
@{ tfm = "$dotnet_version-ios$ios_tpv"; configuration = "Debug" }
2026
) -Skip:(-not $script:simulator) {
2127
BeforeAll {
2228
. $PSScriptRoot/../scripts/device-test-utils.ps1

integration-test/net9-maui/Sentry.Maui.Device.IntegrationTestApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- Pin target iOS version so that our tests don't break when new versions of Xcode are released.
66
'netX.0-ios' resolves the latest version of the iOS SDK otherwise.
77
-->
8-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios26.2</TargetFrameworks>
8+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios26.0;net10.0-ios26.2</TargetFrameworks>
99

1010
<OutputType>Exe</OutputType>
1111
<RootNamespace>Sentry.Maui.Device.IntegrationTestApp</RootNamespace>

test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>$(TargetFrameworks);net9.0-android;net10.0-android</TargetFrameworks>
5-
<!-- Note: we can't run against net9-ios because .NET 10 requires Xcode 26.2 and .NET 9 requires Xcode 26.0.
6-
The macOS GitHub Actions runners only have Xcode 26.1+ installed and no support for Xcode 26.2 is planned for
7-
net9.0-ios: https://github.com/dotnet/macios/issues/24199#issuecomment-3819021247
8-
-->
9-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios;net10.0-ios</TargetFrameworks>
106
<DefineConstants Condition="'$(EnableMauiDeviceTestVisualRunner)' == 'true'">$(DefineConstants);VISUAL_RUNNER</DefineConstants>
117
</PropertyGroup>
128

@@ -38,7 +34,8 @@
3834
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3935
<!-- Pin target iOS version so that our tests don't break when new versions of Xcode are released.
4036
'netX.0-ios' resolves the latest version of the iOS SDK otherwise. -->
41-
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">26.2</TargetPlatformVersion>
37+
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(TargetFramework)' == 'net10.0-ios'">26.2</TargetPlatformVersion>
38+
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(TargetFramework)' == 'net9.0-ios'">26.0</TargetPlatformVersion>
4239
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
4340

4441
<!-- Avoid errors of Sentry.Testing not being a self-contained executable, while including it in a self-contained executable (this).

0 commit comments

Comments
 (0)