Skip to content

Comments

chore: optimize the CI flow#4247

Merged
jamescrosswell merged 14 commits intomainfrom
ci/flow
Jun 15, 2025
Merged

chore: optimize the CI flow#4247
jamescrosswell merged 14 commits intomainfrom
ci/flow

Conversation

@jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Jun 3, 2025

Run integration tests after the .NET build step without waiting for the publishing macOS build, to receive results for Windows and Linux runners ~45min earlier.

Before

All platforms ran integration tests against a NuGet package built on macOS with sentry-native libraries included for all platforms.

After

Windows and Linux run integration tests against a locally built NuGet package with a sentry-native library for that same platform only.

ETA

Runner Before After
ubuntu-22.04 ~1h 10min ~20min
ubuntu-22.04-arm ~1h 5min ~15min
alpine:3.21 ~1h 5min ~15min
windows-latest ~1h 15min ~30min
windows-11-arm ~1h 15min ~30min
macos-15 (*) ~1h 40min ~1h 30min

(*) Almost unchanged except that it runs one Setup Environment step less.

#skip-changelog

jpnurmi added 5 commits June 3, 2025 18:01
> Describing MAUI
> Error: [-] Describe MAUI failed
> Message
>   ItemNotFoundException: Cannot find path '/home/runner/work/sentry-dotnet/sentry-dotnet/src/Sentry.Maui/bin/Release/Sentry.Maui.5.9.0.nupkg' because it does not exist.
>   at RegisterLocalPackage, /home/runner/work/sentry-dotnet/sentry-dotnet/integration-test/common.ps1:79
>   at <ScriptBlock>, /home/runner/work/sentry-dotnet/sentry-dotnet/integration-test/cli.Tests.ps1:115
@jpnurmi jpnurmi changed the title WIP: CI: provide faster feedback for "no mobile" builds WIP: CI: provide faster feedback for non-publishing builds Jun 3, 2025
@bruno-garcia bruno-garcia requested a review from vaind June 4, 2025 14:52
steps:
- uses: actions/checkout@v4
- name: Sparse checkout
if: env.CI_PUBLISHING_BUILD == 'true'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if this is specific to the publishing build or macOS, but here's the integration test error for reference. Other runners have no problems, this only occurs on macOS if we don't switch to a sparse checkout:

building maui-app
      Determining projects to restore...
      All projects are up-to-date for restore.
      Detected signing identity:
              
        Bundle Id: com.companyname.mauiapp
        App Id: com.companyname.mauiapp
      maui-app -> /maui-app/bin/Release/net8.0-ios17.0/iossimulator-arm64/maui-app.dll
      Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
      Optimizing assemblies for size. This process might take a while.
      Tool /Users/runner/.dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.iossimulator-arm64/8.0.15/Sdk/../tools/mono-aot-cross execution finished (exit code = 137).
              
    /Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.0/17.0.8523/targets/Xamarin.Shared.Sdk.targets(1214,3): error : Failed to AOT compile aot-instances.dll, the AOT compiler exited with code 137. [/maui-app/maui-app.csproj::TargetFramework=net8.0-ios17.0]
      Tool /Users/runner/.dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.iossimulator-arm64/8.0.15/Sdk/../tools/mono-aot-cross execution finished (exit code = 1).
              
    /Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.0/17.0.8523/targets/Xamarin.Shared.Sdk.targets(1214,3): error : Failed to AOT compile Microsoft.iOS.dll, the AOT compiler exited with code 1. [/maui-app/maui-app.csproj::TargetFramework=net8.0-ios17.0]
    
    Build FAILED.
    
    /Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.0/17.0.8523/targets/Xamarin.Shared.Sdk.targets(1214,3): error : Failed to AOT compile aot-instances.dll, the AOT compiler exited with code 137. [/maui-app/maui-app.csproj::TargetFramework=net8.0-ios17.0]
    /Users/runner/.dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.0/17.0.8523/targets/Xamarin.Shared.Sdk.targets(1214,3): error : Failed to AOT compile Microsoft.iOS.dll, the AOT compiler exited with code 1. [/maui-app/maui-app.csproj::TargetFramework=net8.0-ios17.0]
        0 Warning(s)
        2 Error(s)

@jpnurmi jpnurmi changed the title WIP: CI: provide faster feedback for non-publishing builds chore: optimize the CI flow Jun 5, 2025
@jpnurmi jpnurmi marked this pull request as ready for review June 5, 2025 12:29
@jpnurmi jpnurmi requested a review from Flash0ver as a code owner June 5, 2025 12:29
$(RuntimeIdentifier) is not set during `dotnet pack`
@jamescrosswell
Copy link
Collaborator

Before
All platforms ran integration tests against a NuGet package built on macOS with sentry-native libraries included for all platforms.

After
Windows and Linux run integration tests against a locally built NuGet package with a sentry-native library for that same platform only.

As I recall, it was done this way because the NuGet packages that get uploaded to nuget.org get built on the macOS runner... so the intention here was to make sure that we were running the tests against the exact same version of the code that we were shipping.

If we use separate builds of the NuGets (built using different processors and operating systems) then we're not necessarily testing the exact same thing that we're shipping to customers.

@bruno-garcia might have some input here.

@bruno-garcia
Copy link
Member

As I recall, it was done this way because the NuGet packages that get uploaded to nuget.org get built on the macOS runner... so the intention here was to make sure that we were running the tests against the exact same version of the code that we were shipping.

If we use separate builds of the NuGets (built using different processors and operating systems) then we're not necessarily testing the exact same thing that we're shipping to customers.

Right but does it matter? the #ifdef is about the compilation target, we're still running the code that will be generated for the right platform. Otherwise we're testing .NET's ability to cross compile, no?

@jamescrosswell jamescrosswell self-requested a review June 10, 2025 08:38
Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

LGTM

@jamescrosswell jamescrosswell merged commit 9eaaa15 into main Jun 15, 2025
29 checks passed
@jamescrosswell jamescrosswell deleted the ci/flow branch June 15, 2025 23:13
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.

4 participants