-
-
Notifications
You must be signed in to change notification settings - Fork 230
ci: Use Cirrus Runners for iOS integration tests #4951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
1df212b
192b825
25b97b3
04a5b89
7f51356
175a733
ebc5740
aff5bf1
841dbc3
7d8d1ed
3776ef8
6ec1266
f62fba8
23897f2
f5cb993
b68bb19
2746f32
2405b8e
847e5e8
ba35dc4
c294951
ea37662
bec18f0
aa77b0c
d638ee1
d4cf33f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 -Verbose | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Environment action hardcodes Xcode 26.2 breaking net9.0 runnerHigh Severity The Additional Locations (1)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed via ba35dc4 by accepting an optional |
||
| 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: 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 (<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" } | ||
|
||
| ) -Skip:(-not $script:simulator) { | ||
| BeforeAll { | ||
| . $PSScriptRoot/../scripts/device-test-utils.ps1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,11 +2,7 @@ | |||||
|
|
||||||
| <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> | ||||||
| <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net9.0-ios;net10.0-ios</TargetFrameworks> | ||||||
| <DefineConstants Condition="'$(EnableMauiDeviceTestVisualRunner)' == 'true'">$(DefineConstants);VISUAL_RUNNER</DefineConstants> | ||||||
| </PropertyGroup> | ||||||
|
|
||||||
|
|
@@ -36,9 +32,10 @@ | |||||
|
|
||||||
| <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. | ||||||
| <!-- 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> | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" ( sentry-dotnet/Directory.Build.props Lines 34 to 35 in 815d9fb
Where we would need to - likewise - change the CI runner to Which was actually the original status before updating the Integration Tests to .NET 10: |
||||||
| <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). | ||||||
|
|
||||||




There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).