Skip to content

ci: install only the workloads each build leg needs - #5784

Draft
ric-oliv wants to merge 2 commits into
mainfrom
ci/restore-workloads-per-leg
Draft

ric-oliv wants to merge 2 commits into
mainfrom
ci/restore-workloads-per-leg

Conversation

@ric-oliv

@ric-oliv ric-oliv commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Setup Environment runs dotnet workload restore without a project, so it evaluates every project in Sentry.slnx, whatever the leg builds. From the logs of run 39858273561:

  • The three Linux legs without mobile targets install android, maui-android, maui-tizen, macos, wasm-tools and wasm-tools-net9, which takes 83 to 113 seconds.
  • Windows installs ios, maccatalyst and macos, but it only builds Android and Windows targets.
  • Every leg installs maui-tizen, which nothing targets, and macos, which only Sentry.Samples.MacOS needs.
  • Every leg restores the Android test app, which only the macOS and linux-x64 filters need, because they include Sentry.Android.AssemblyReader.Tests.

This PR scopes the step to what the leg builds:

  • build-sentry passes its solution filter to Setup Environment, and the step restores the workloads for the projects in it. dotnet workload restore rejects a solution filter with "Couldn't find a project", so the step passes the filter's projects instead. I checked locally that this installs only what those projects need. If it finds no projects in the filter, the step stops with an error that names the filter.
  • The Android test app restore runs only when the filter includes the tests that build it.
  • The legs without mobile targets skip Java and the Android SDK.
  • The other jobs that use Setup Environment don't pass a filter, so they keep the current behavior.

This PR leaves Mono alone, and #5794 removes it. The MAUI integration test restores its own workloads in CI, so it isn't affected.

Measured on two runs of this PR, against the median of 7 main runs from October 22 and 23:

Setup Environment main Run 1 Run 2
macOS 3.1 min 2.6 2.6
win-x64 5.4 3.3 4.3
win-arm64 8.7 6.5 4.8
linux-x64 3.4 2.7 2.8
linux-arm64 3.4 2.0 1.9
linux-musl-x64 2.8 1.1 1.8
linux-musl-arm64 3.0 1.2 1.4

This overlaps #5782 on Windows, which changes where .NET is installed, and both skip the Android test app there. I'm keeping them apart so we can see what each one is worth, and I'll resolve the conflict when the second one merges.

#skip-changelog

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.14%. Comparing base (ff0355e) to head (9ad251a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5784      +/-   ##
==========================================
+ Coverage   76.13%   76.14%   +0.01%     
==========================================
  Files         528      528              
  Lines       19579    19579              
  Branches     3829     3829              
==========================================
+ Hits        14906    14909       +3     
+ Misses       3791     3788       -3     
  Partials      882      882              

☔ View full report in Codecov by Harness.
📢 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.

Setup Environment runs dotnet workload restore without a project, so it
evaluates every project in Sentry.slnx on every leg. The three Linux legs
without mobile targets install android, maui-android, maui-tizen, macos,
wasm-tools and wasm-tools-net9. Windows installs ios, maccatalyst and macos.
Every leg installs maui-tizen, which nothing targets, and macos, which only
the macOS sample needs.

The build legs now pass their solution filter, and the step restores the
workloads for the projects in it. dotnet workload restore doesn't accept a
solution filter, so the step passes its projects. The Android test app is
restored only when the filter includes the tests that build it, and the legs
without mobile targets skip Java and the Android SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The step reads the project paths out of the solution filter. If that
found none, grep's exit code already failed the step, but without a
message. It now names the filter it couldn't read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant