Skip to content

ci: add build-samples workflow for Phase 1 low-workload samples#512

Merged
adrianhall merged 1 commit into
CommunityToolkit:mainfrom
adrianhall:issues/509
Jul 7, 2026
Merged

ci: add build-samples workflow for Phase 1 low-workload samples#512
adrianhall merged 1 commit into
CommunityToolkit:mainfrom
adrianhall:issues/509

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Summary

Closes part of #509 (Phase 1 of the samples CI rollout).

/samples previously had zero CI coverage. This adds a build-samples.yml workflow that builds the plain net10.0 samples with no extra workloads on ubuntu-latest, triggered on any PR/push to main touching samples/**.

What's included (Phase 1 — no extra workloads, ubuntu-latest)

  • datasync-server (Sample.Datasync.Server.sln)
  • datasync-server-cosmosdb-singlecontainer (Datasync.Server.CosmosDb.SingleContainer.sln)
  • todoapp-mvc (part5.sln)
  • todoapp-blazor-wasm (TodoApp.BlazorWasm.sln)
  • todoapp-tutorialServerApp.csproj only
  • Avalonia TodoApp — shared (TodoApp.Avalonia.csproj) + Desktop (TodoApp.Avalonia.Desktop.csproj) projects directly, not the full .sln

Design

  • One reusable workflow file per sample (build-samples-<name>.yml, on: workflow_call), each doing checkoutsetup-dotnet (10.0.x) → dotnet restoredotnet build --configuration Release.
  • A single orchestrator, build-samples.yml, owns the pull_request/push/workflow_dispatch triggers and path filter (samples/**, .github/workflows/build-samples*.yml), and calls each per-sample workflow as a job.
  • An all-samples-built gate job aggregates the results so branch protection only needs one required check as more samples are added over time.

Findings during implementation

While verifying the issue's inventory table against the actual sample projects, I found two things that don't fit a ubuntu-latest/no-workload Phase 1 build and filed them as separate follow-ups so they can be picked up independently:

Verification

  • actionlint passes on all 7 new workflow files.
  • Locally ran dotnet restore + dotnet build --configuration Release for each of the 6 build targets covered by this PR — all succeed with 0 errors (Blazor WASM Client builds fine without the wasm-tools workload, contrary to the issue's speculation that it might be needed).
  • Ran a full dotnet restore && dotnet build --configuration Release at the repo root to confirm no regressions to the main library/test build (0 errors). Did not run the full dotnet test suite — this PR touches only .github/workflows/, and the local environment lacks Docker for the TestContainers-based integration tests (a pre-existing, unrelated environment limitation noted in the README).

…unityToolkit#509)

Adds CI coverage for /samples, which previously had none. Introduces a
build-samples.yml orchestrator that calls one reusable per-sample
workflow per build target, plus an all-samples-built gate job so
branch protection only needs a single required check.

Phase 1 scope covers the plain net10.0 samples that build on
ubuntu-latest with no extra workloads:
- datasync-server
- datasync-server-cosmosdb-singlecontainer
- todoapp-mvc
- todoapp-blazor-wasm
- todoapp-tutorial (ServerApp only; ClientApp is WPF/net10.0-windows,
  tracked in CommunityToolkit#510)
- Avalonia shared + Desktop projects (not the full .sln, to exclude
  the Android/iOS heads, tracked in CommunityToolkit#511)

Windows-only heads (WPF, WinUI3, MAUI-Windows, tutorial ClientApp) and
mobile heads (Android, iOS, Uno) are filed as separate follow-up
issues (CommunityToolkit#510, CommunityToolkit#511) per the phased rollout the issue recommended.
@adrianhall adrianhall merged commit 92b777b into CommunityToolkit:main Jul 7, 2026
9 checks passed
@adrianhall adrianhall deleted the issues/509 branch July 7, 2026 11:52
adrianhall added a commit that referenced this pull request Jul 7, 2026
* ci: add build-samples workflow for Phase 3 mobile heads (#511)

Adds CI coverage for the Android/iOS/Uno mobile build heads deferred
from Phase 1 (#509/#512) and Phase 2 (#510/#514):

- build-samples-todoapp-avalonia.yml: add android (ubuntu-latest) and
  ios (macos-latest) jobs for TodoApp.Avalonia.Android/.iOS.
- build-samples-todoapp-maui.yml (new): android and ios jobs for
  TodoApp.MAUI, each scoped to a single TargetFramework via
  -p:TargetFramework / -f (the Windows head remains in
  build-samples-todoapp-windows.yml from Phase 2).
- build-samples-todoapp-uno.yml (new): one job per TodoApp.Uno head
  (android, ios+maccatalyst, windows, browserwasm, desktop), each
  restoring/building the single multi-TFM project scoped to one
  TargetFramework at a time.
- build-samples.yml: wire the two new sample workflows into the
  orchestrator and the all-samples-built gate.

The desktop head is intentionally NOT marked continue-on-error here.
#506's NU1903 (Tmds.DBus) finding is a NuGet audit warning only and
this repo does not configure NuGet audit to fail builds. #506 also
reports a NU1605 hit while investigating that warning, but that has
not been confirmed to reproduce today or to be desktop-specific
(CommunityToolkit.WinUI.Behaviors is referenced unconditionally in
TodoApp.Uno.csproj), so all Uno heads are left as normal, blocking
jobs pending real CI signal.

actionlint passes on all 5 changed/new workflow files. Verified
'dotnet restore/build Datasync.Toolkit.sln --configuration Release'
still succeeds with 0 warnings/errors (no regression to the core
library). The mobile/Uno workload installs and builds themselves
cannot be verified locally (no Android SDK, no full Xcode, no
Windows) and will be confirmed once CI runs on this branch.

* fix: align Info.plist MinimumOSVersion with SupportedOSPlatformVersion for TodoApp.Avalonia.iOS

CI (added in #511) surfaced a pre-existing mismatch: Info.plist declared
MinimumOSVersion 13.0 while TodoApp.Avalonia.iOS.csproj declares
SupportedOSPlatformVersion 15.0, which the iOS build task hard-fails on
('The MinimumOSVersion value in the Info.plist (13.0) does not match
the SupportedOSPlatformVersion value (15.0) in the project file').
Bump Info.plist's MinimumOSVersion to 15.0 to match the csproj, which
is treated as the source of truth here.

Unrelated to this fix: the same CI run also surfaced a pre-existing
CS8604 nullable-reference warning in the shared LoggingHandler.cs.
It does not fail the build (the run reported 1 warning, 1 error - only
the Info.plist mismatch was the error) and is left untouched to keep
this change scoped to the actual build failure.

* ci: disable todoapp-uno job pending #506

CI confirmed the NU1605 (Uno.WinUI 5.5.87 vs 5.4.22, driven by
CommunityToolkit.WinUI.Behaviors' floor vs. the Uno.Sdk pin in
global.json) is not desktop-specific as originally suspected in #511 -
it fails restore for every TodoApp.Uno head (confirmed via the
android-head CI log and locally reproduced on net10.0-desktop, no
workload required), since CommunityToolkit.WinUI.Behaviors is
referenced unconditionally in TodoApp.Uno.csproj.

Comment out the todoapp-uno job in build-samples.yml's orchestrator
(and drop it from all-samples-built's needs) rather than trying to
patch around it here. build-samples-todoapp-uno.yml itself is left
fully intact (one job per head, TFM-scoped restore/build) and just
needs to be wired back in once #506 lands a fix and
TodoApp.Uno.csproj restores cleanly.

Posted the concrete reproduction details to #506 so the fix for that
issue also covers re-enabling this CI job.

---------

Co-authored-by: ahall <ahall@cloudflare.com>
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