Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1df212b
ci: Use Cirrus Runners for iOS integration tests
Flash0ver Feb 23, 2026
192b825
test: add deliberate failure
Flash0ver Feb 24, 2026
25b97b3
Apply suggestions from code review
Flash0ver Feb 24, 2026
04a5b89
ci: Reorder matrix and fix Xcode image tag for net10.0
Flash0ver Feb 24, 2026
7f51356
ci: Add FIFO concurrency groups for Cirrus iOS runners
Flash0ver Feb 24, 2026
175a733
ci: Install PowerShell via dotnet global tool on Cirrus runners
Flash0ver Feb 24, 2026
ebc5740
ci: Add dotnet tools dir to PATH after installing PowerShell
Flash0ver Feb 24, 2026
aff5bf1
build: Update XHarness CLI to 10.0.0-prerelease.25622.2
Flash0ver Feb 25, 2026
841dbc3
ci: Select correct Xcode version before building iOS test app
Flash0ver Feb 25, 2026
7d8d1ed
cI: add debug info
Flash0ver Feb 26, 2026
3776ef8
ci: fix invalid workflow file
Flash0ver Feb 26, 2026
6ec1266
ci: fix invalid workflow file
Flash0ver Feb 26, 2026
f62fba8
Merge branch 'main' into ci/cirrus-runners-for-integration-tests-on-m…
Flash0ver Mar 2, 2026
23897f2
test: remove deliberate failure
Flash0ver Mar 2, 2026
f5cb993
docs: update CSPROJ comment
Flash0ver Mar 2, 2026
b68bb19
ci: normalize iOS tests
Flash0ver Mar 2, 2026
2746f32
revert: cI: add debug info
Flash0ver Mar 2, 2026
2405b8e
ci: change cirrus runner image xcode version
Flash0ver Mar 2, 2026
847e5e8
ci: fix missing Xcode version
Flash0ver Mar 2, 2026
ba35dc4
ci: make Xcode version overwritable
Flash0ver Mar 2, 2026
c294951
ci: Install Pester on Cirrus Runners
Flash0ver Mar 2, 2026
ea37662
ci: change cirrus runner image xcode version
Flash0ver Mar 3, 2026
bec18f0
test: update iOS Device-TestApp to available Xcode version
Flash0ver Mar 3, 2026
aa77b0c
ci: trust PSGallery repository
Flash0ver Mar 3, 2026
d638ee1
ci: omit MinimumVersion of Pester to mimic GitHub-hosted images
Flash0ver Mar 3, 2026
d4cf33f
ci: restore previous behavior for CI on GitHub Actions
Flash0ver Mar 3, 2026
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
15 changes: 14 additions & 1 deletion .github/actions/environment/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Setup Environment
description: Sets env vars and installs dependencies

inputs:
xcode-version:
description: 'Xcode version to select (e.g. "26.2").'
required: false
default: ''

runs:
using: composite

Expand Down Expand Up @@ -46,10 +53,16 @@ runs:
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
# Also https://github.com/dotnet/macios/issues/21762#issuecomment-3424033859 (don't reference symlinks)
- name: Pin the Xcode Version
if: runner.os == 'macOS'
if: runner.os == 'macOS' && inputs.xcode-version == ''
shell: bash
run: sudo xcode-select --switch /Applications/Xcode_26.2.app

# Cirrus Runners offer different images with various versions of Xcode installed
- name: Pin the Xcode Version to ${{ inputs.xcode-version }}
if: runner.os == 'macOS' && inputs.xcode-version != ''
shell: bash
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app

# Java 17 is needed for Android SDK setup step
- name: Install Java 17
if: ${{ !matrix.container }}
Expand Down
48 changes: 37 additions & 11 deletions .github/workflows/device-tests-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -70,41 +81,56 @@ jobs:

- name: Setup Environment
uses: ./.github/actions/environment
with:
xcode-version: ${{ matrix.xcode }}

- name: Install PowerShell
run: |
which pwsh || (dotnet tool install --global PowerShell && echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH")

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

run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }} -Verbose

- 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 -Verbose
run: pwsh scripts/device-test.ps1 ios -Run -Tfm ${{ matrix.tfm }} -Verbose

- 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: Install Pester
shell: pwsh
run: |
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Install-Module -Name Pester -Scope CurrentUser

- 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
1 change: 1 addition & 0 deletions Sentry.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<File Path="integration-test/runtime.Tests.ps1" />
</Folder>
<Folder Name="/integration-test/net4-console/" />
<Folder Name="/integration-test/net9-maui/" />
<Folder Name="/modules/">
<File Path="modules/sentry-cocoa.properties" />
<Project Path="modules/perfview/src/FastSerialization/FastSerialization.csproj" />
Expand Down
23 changes: 15 additions & 8 deletions integration-test/ios.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
param(
[string] $dotnet_version = "net10.0"
)

# This file contains test cases for https://pester.dev/
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
. $PSScriptRoot/pester.ps1
. $PSScriptRoot/common.ps1
. $PSScriptRoot/../scripts/device-test-utils.ps1

BeforeDiscovery {
Expand All @@ -11,15 +16,17 @@ BeforeDiscovery {
$script:simulator = Get-IosSimulatorUdid -PreferredStates @('Booted')
}

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" }
) -Skip:(-not $script:simulator) {
$ios_tpv = switch ($dotnet_version) {
'net9.0' { '26.0' }
default { '26.2' }
}
$cases = @(
@{ configuration = 'Release' }
@{ configuration = 'Debug' }
)
Describe 'iOS app (<dotnet_version>, <configuration>)' -ForEach $cases -Skip:(-not $script:simulator) {
BeforeAll {
. $PSScriptRoot/../scripts/device-test-utils.ps1
$tfm = "$dotnet_version-ios$ios_tpv"

Remove-Item -Path "$PSScriptRoot/mobile-app" -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path "$PSScriptRoot/net9-maui" -Destination "$PSScriptRoot/mobile-app" -Recurse -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android35.0;net10.0-android36.0</TargetFrameworks>
<!-- Pin target iOS version so that our tests don't break when new versions of Xcode are released.
'netX.0-ios' resolves the latest version of the iOS SDK otherwise.
-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios26.2</TargetFrameworks>
<!-- GitHub-hosted runners no longer have Xcode 26.0 installed. No Xcode 26.2 support for net9.0-ios.
Pin target iOS version, 'netX.0-ios' resolves the latest version of the iOS SDK otherwise.
see: https://github.com/dotnet/macios/issues/24199#issuecomment-3819021247 -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX')) And '$(GITHUB_ACTIONS)' == 'true'">$(TargetFrameworks);net10.0-ios26.2</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX')) And '$(GITHUB_ACTIONS)' != 'true'">$(TargetFrameworks);net9.0-ios18.0;net10.0-ios26</TargetFrameworks>

<OutputType>Exe</OutputType>
<RootNamespace>Sentry.Maui.Device.IntegrationTestApp</RootNamespace>
Expand Down Expand Up @@ -34,7 +35,6 @@

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<PropertyGroup>
<TargetFrameworks>$(TargetFrameworks);net9.0-android;net10.0-android</TargetFrameworks>
<!-- Note: we can't run against net9-ios because .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
-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios</TargetFrameworks>
<!-- GitHub-hosted runners no longer have Xcode 26.0 installed. No Xcode 26.2 support for net9.0-ios.
see: https://github.com/dotnet/macios/issues/24199#issuecomment-3819021247 -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX')) And '$(GITHUB_ACTIONS)' == 'true'">$(TargetFrameworks);net10.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX')) And '$(GITHUB_ACTIONS)' != 'true'">$(TargetFrameworks);net9.0-ios;net10.0-ios</TargetFrameworks>
<DefineConstants Condition="'$(EnableMauiDeviceTestVisualRunner)' == 'true'">$(DefineConstants);VISUAL_RUNNER</DefineConstants>
</PropertyGroup>

Expand Down Expand Up @@ -36,9 +35,11 @@

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<!-- Pin target iOS version so that our tests don't break when new versions of Xcode are released.
'netX.0-ios' resolves the latest version of the iOS SDK otherwise. -->
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">26.2</TargetPlatformVersion>
<!-- Pin target iOS version so that our CI build doesn't break when new versions of Xcode are released for GitHub-hosted Actions Runner Images.
Cirrus Runners images are available with defined Xcode versions pre-installed.
'netX.0-ios' resolves the latest version of the iOS SDK otherwise. -->
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(TargetFramework)' == 'net9.0-ios'">26.0</TargetPlatformVersion>
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(TargetFramework)' == 'net10.0-ios'">26.2</TargetPlatformVersion>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>

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