Repository navigation
Add CI workflow to build all /samples projects on PR #509
Description
Summary
Surfaced during the #499 / #508 investigation (and noted as a gap in #507): /samples has no CI coverage at all today. None of the existing workflows (build-library.yml, build-docs.yml, build-template.yml) touch the samples/** path, so a PR can introduce a broken sample (bad package bump, breaking API change, stale TargetFramework, etc.) and nothing will catch it until someone manually opens the solution or a security scan flags a transitive dependency. That's effectively what happened with #492/#498/#499/#506 — none of those regressions were caught by CI.
This issue asks for a new workflow that builds every sample solution whenever a PR touches samples/**, mirroring the path-filtered pull_request trigger pattern already used by build-library.yml and build-template.yml.
Inventory of what needs building
| Sample | Solution | TFMs | Runner / workload needs |
|---|---|---|---|
| Avalonia TodoApp | samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.sln |
net10.0 (shared+desktop), net10.0-android, net10.0-ios |
ubuntu-latest for shared+desktop; android workload for Android head; ios workload + macOS/Xcode for iOS head |
| Uno TodoApp | samples/todoapp/TodoApp.Uno/TodoApp.Uno.sln |
net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-windows10.0.26100;net10.0-browserwasm;net10.0-desktop |
Uno.Sdk (pinned via global.json, currently 5.4.5) + android/ios/maui/wasm-tools workloads across runners; note: the desktop head currently has a pre-existing NU1605 (Uno.WinUI version mismatch) per #506 that will need resolving before this head builds cleanly in CI |
| WinUI3 / WPF / MAUI TodoApp | samples/todoapp/Samples.TodoApp.sln |
net10.0-windows10.0.19041.0 (WinUI3), net10.0-windows (WPF), net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-windows10.0.26100;net10.0-browserwasm;net10.0-desktop (MAUI) |
windows-latest required for WinUI3/WPF and the MAUI Windows TFM; maui/android/ios workloads for the rest |
| Datasync server sample | samples/datasync-server/Sample.Datasync.Server.sln |
net10.0 |
ubuntu-latest, no extra workloads |
| Datasync server (Cosmos DB) sample | samples/datasync-server-cosmosdb-singlecontainer/Datasync.Server.CosmosDb.SingleContainer.sln |
net10.0 |
ubuntu-latest, no extra workloads (the infra/ Bicep/Terraform, if present, is out of scope for a dotnet build job) |
| TodoApp tutorial | samples/todoapp-tutorial/todoapp.sln |
net10.0 |
ubuntu-latest, no extra workloads |
| TodoApp MVC | samples/todoapp-mvc/part5.sln |
net10.0 |
ubuntu-latest, no extra workloads |
| TodoApp Blazor WASM | samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.sln |
net10.0 |
ubuntu-latest, likely needs wasm-tools workload for the client head |
Suggested approach
Given how heterogeneous the runner/workload requirements are across this list, a single dotnet build **/*.sln step won't work. Suggest a phased rollout instead of trying to cover everything in one PR:
- Phase 1 — low-hanging fruit: add a
build-samples.ymlworkflow (triggered onpull_request/pushtomainwithpaths: ['samples/**', '.github/workflows/build-samples.yml']) that builds the plainnet10.0samples with no extra workloads onubuntu-latest:datasync-server,datasync-server-cosmosdb-singlecontainer,todoapp-tutorial,todoapp-mvc,todoapp-blazor-wasm, and the Avalonia shared+Desktop projects (TodoApp.Avalonia.csproj+TodoApp.Avalonia.Desktop.csproj) specifically (not the full.sln, to avoid pulling in the Android/iOS heads before workloads are set up). - Phase 2 — Windows-only heads: add a
windows-latestjob forTodoApp.WPF,TodoApp.WinUI3, and the MAUI Windows TFM. - Phase 3 — mobile heads: add
android/ios/mauiworkload installation steps and build the Android/iOS heads for Avalonia, Uno, and MAUI. iOS builds will need a macOS runner. This phase should start with Avalonia (the pattern is simplest — 2 mobile heads, no Uno.Sdk complications) before attempting Uno, since Uno's desktop head is currently blocked by the unrelatedNU1605from Investigate resolving NU1903 for Tmds.DBus in Uno desktop sample #506. - Consider
continue-on-error: true(or excluding entirely) for any sample/head known to have a pre-existing, unrelated build break (e.g., Uno desktop per Investigate resolving NU1903 for Tmds.DBus in Uno desktop sample #506) until that's fixed, so the new workflow doesn't start life red for reasons outside a given PR's control.
Should be build-only (dotnet restore + dotnet build), not run/test — most of these are UI apps without a practical headless test story today. A follow-up could explore headless Avalonia UI tests, but that's out of scope here.
Related
- Investigate resolving NU1903 for Tmds.DBus.Protocol in Avalonia desktop sample #499 / fix: resolve NU1903 for Tmds.DBus.Protocol in Avalonia sample by bumping to 11.3.18 #508 — Avalonia
Tmds.DBus.ProtocolNU1903 fix, merged with no CI verification beyond manualdotnet build. - Investigate resolving NU1903 for Tmds.DBus in Uno desktop sample #506 — Uno
Tmds.DBusNU1903 investigation; blocked by the pre-existing Uno.WinUINU1605that this new workflow would also need to contend with. - Major-version bump: Avalonia 11 → 12 (TodoApp.Avalonia sample) #507 — Avalonia 11 → 12 major-version-bump follow-up; explicitly called out the lack of samples CI coverage as a risk for that migration.
Activity
adrianhall commentedon Jul 7, 2026
Filed the phased rollout as separate tracking issues so each can be picked up independently:
samples/todoapp-tutorial/todoapp.sln'sClientAppis actually WPF (net10.0-windows), not plainnet10.0— so it can't be covered by the ubuntu-only Phase 1 workflow and is picked up in Add CI workflow to build Windows-only /samples heads (Phase 2 of #509) #510 instead.This issue now tracks Phase 1 only: a
build-samples.ymlworkflow (with one reusable per-sample workflow file, orchestrated by a gate job) that builds the plainnet10.0samples with no extra workloads onubuntu-latest:datasync-serverdatasync-server-cosmosdb-singlecontainertodoapp-mvctodoapp-blazor-wasmtodoapp-tutorial(ServerApponly — see Add CI workflow to build Windows-only /samples heads (Phase 2 of #509) #510 forClientApp).sln)PR incoming.
ci: add build-samples workflow for Phase 1 low-workload samples (#509) (
ci: add build-samples workflow for Phase 2 Windows-only heads (#510) (#…
ci: add build-samples workflow for Phase 3 mobile heads (#511) (#519)
adrianhall commentedon Jul 7, 2026
All three phases completed now. Review #506 for additional work to be done.