Skip to content

Commit bf21dc8

Browse files
adrianhallahall
andauthored
ci: add build-samples workflow for Phase 3 mobile heads (#511) (#519)
* 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>
1 parent 634cf71 commit bf21dc8

6 files changed

Lines changed: 312 additions & 10 deletions

File tree

.github/workflows/build-samples-todoapp-avalonia.yml

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ env:
88
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
99
DOTNET_NOLOGO: true
1010
DOTNET_CONFIGURATION: 'Release'
11-
# NOTE: This sample's solution (TodoApp.Avalonia.sln) also contains Android and iOS
12-
# heads (net10.0-android / net10.0-ios), which require mobile workloads and are tracked
13-
# separately in https://github.com/CommunityToolkit/Datasync/issues/511 (Phase 3). Only
14-
# the shared and Desktop (net10.0) projects are built directly here, not the full .sln.
11+
# NOTE: This sample's solution (TodoApp.Avalonia.sln) also contains Android and iOS heads
12+
# (net10.0-android / net10.0-ios). Only the shared and Desktop (net10.0) projects are built
13+
# directly here, not the full .sln - the Android and iOS heads are built by their own jobs
14+
# below, each restoring/building its own project directly so only the workload needed for
15+
# that head is installed on that runner.
1516
SharedProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/TodoApp.Avalonia.csproj'
1617
DesktopProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.Desktop/TodoApp.Avalonia.Desktop.csproj'
18+
AndroidProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.Android/TodoApp.Avalonia.Android.csproj'
19+
iOSProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.iOS/TodoApp.Avalonia.iOS.csproj'
1720

1821
permissions:
1922
contents: read
2023

2124
jobs:
22-
build:
25+
desktop:
2326
runs-on: ubuntu-latest
2427
steps:
2528
- name: Checkout Repository
@@ -47,3 +50,50 @@ jobs:
4750
dotnet build ${{ env.DesktopProjectFile }}
4851
--configuration ${{ env.DOTNET_CONFIGURATION }}
4952
--no-restore
53+
54+
android:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout Repository
58+
uses: actions/checkout@v7
59+
60+
- name: Setup .NET
61+
uses: actions/setup-dotnet@v5
62+
with:
63+
dotnet-version: ${{ env.DOTNET_VERSION }}
64+
65+
- name: Install Android workload
66+
run: dotnet workload install android
67+
68+
- name: Restore Android project
69+
run: dotnet restore ${{ env.AndroidProjectFile }}
70+
71+
- name: Build Android project
72+
run: >
73+
dotnet build ${{ env.AndroidProjectFile }}
74+
--configuration ${{ env.DOTNET_CONFIGURATION }}
75+
--no-restore
76+
77+
ios:
78+
# iOS builds require Xcode, which is only available on macOS runners.
79+
runs-on: macos-latest
80+
steps:
81+
- name: Checkout Repository
82+
uses: actions/checkout@v7
83+
84+
- name: Setup .NET
85+
uses: actions/setup-dotnet@v5
86+
with:
87+
dotnet-version: ${{ env.DOTNET_VERSION }}
88+
89+
- name: Install iOS workload
90+
run: dotnet workload install ios
91+
92+
- name: Restore iOS project
93+
run: dotnet restore ${{ env.iOSProjectFile }}
94+
95+
- name: Build iOS project
96+
run: >
97+
dotnet build ${{ env.iOSProjectFile }}
98+
--configuration ${{ env.DOTNET_CONFIGURATION }}
99+
--no-restore
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build Sample - TodoApp MAUI (Android / iOS)
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
DOTNET_VERSION: '10.0.x'
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
9+
DOTNET_NOLOGO: true
10+
DOTNET_CONFIGURATION: 'Release'
11+
# TodoApp.MAUI.csproj targets net10.0-android;net10.0-ios, with net10.0-windows10.0.19041.0
12+
# conditionally appended only when building on Windows (that head is built separately in
13+
# build-samples-todoapp-windows.yml). Restore/build here is explicitly scoped to one mobile
14+
# TargetFramework per job so each runner only needs the workload for its own head.
15+
MauiProjectFile: 'samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj'
16+
AndroidTargetFramework: 'net10.0-android'
17+
iOSTargetFramework: 'net10.0-ios'
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
android:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v7
28+
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v5
31+
with:
32+
dotnet-version: ${{ env.DOTNET_VERSION }}
33+
34+
- name: Install MAUI Android workload
35+
run: dotnet workload install maui-android
36+
37+
- name: Restore MAUI project (Android TFM only)
38+
# NOTE: 'dotnet restore' has no -f|--framework option (-f means --force there, unlike
39+
# 'dotnet build'). Use the MSBuild property directly to scope restore to one TFM.
40+
run: dotnet restore ${{ env.MauiProjectFile }} -p:TargetFramework=${{ env.AndroidTargetFramework }}
41+
42+
- name: Build MAUI project (Android TFM only)
43+
run: >
44+
dotnet build ${{ env.MauiProjectFile }}
45+
-f ${{ env.AndroidTargetFramework }}
46+
--configuration ${{ env.DOTNET_CONFIGURATION }}
47+
--no-restore
48+
49+
ios:
50+
# iOS builds require Xcode, which is only available on macOS runners.
51+
runs-on: macos-latest
52+
steps:
53+
- name: Checkout Repository
54+
uses: actions/checkout@v7
55+
56+
- name: Setup .NET
57+
uses: actions/setup-dotnet@v5
58+
with:
59+
dotnet-version: ${{ env.DOTNET_VERSION }}
60+
61+
- name: Install MAUI iOS workload
62+
run: dotnet workload install maui-ios
63+
64+
- name: Restore MAUI project (iOS TFM only)
65+
run: dotnet restore ${{ env.MauiProjectFile }} -p:TargetFramework=${{ env.iOSTargetFramework }}
66+
67+
- name: Build MAUI project (iOS TFM only)
68+
run: >
69+
dotnet build ${{ env.MauiProjectFile }}
70+
-f ${{ env.iOSTargetFramework }}
71+
--configuration ${{ env.DOTNET_CONFIGURATION }}
72+
--no-restore
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Build Sample - TodoApp Uno
2+
3+
# NOTE: This workflow is NOT currently wired into build-samples.yml. TodoApp.Uno.csproj fails
4+
# to restore on every head with NU1605 (Uno.WinUI version downgrade caused by
5+
# CommunityToolkit.WinUI.Behaviors' floor vs. the Uno.Sdk pin in global.json) - see the jobs
6+
# below and https://github.com/CommunityToolkit/Datasync/issues/506, which is tracking the fix.
7+
# Re-add the `todoapp-uno` job to build-samples.yml (and to all-samples-built's `needs`) once
8+
# #506 is resolved and TodoApp.Uno.csproj restores cleanly.
9+
10+
on:
11+
workflow_call:
12+
13+
env:
14+
DOTNET_VERSION: '10.0.x'
15+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
16+
DOTNET_NOLOGO: true
17+
DOTNET_CONFIGURATION: 'Release'
18+
# TodoApp.Uno.csproj is a single Uno.Sdk project with a multi-head TargetFrameworks list
19+
# (net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-windows10.0.26100;
20+
# net10.0-browserwasm;net10.0-desktop). No single runner can build every head (mobile heads
21+
# need Android/iOS workloads, the Windows head needs windows-latest, etc.), so each job below
22+
# restores/builds one head at a time, scoped via the MSBuild TargetFramework property.
23+
UnoProjectFile: 'samples/todoapp/TodoApp.Uno/TodoApp.Uno/TodoApp.Uno.csproj'
24+
AndroidTargetFramework: 'net10.0-android'
25+
iOSTargetFramework: 'net10.0-ios'
26+
MacCatalystTargetFramework: 'net10.0-maccatalyst'
27+
WindowsTargetFramework: 'net10.0-windows10.0.26100'
28+
BrowserWasmTargetFramework: 'net10.0-browserwasm'
29+
DesktopTargetFramework: 'net10.0-desktop'
30+
31+
permissions:
32+
contents: read
33+
34+
jobs:
35+
android:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v7
40+
41+
- name: Setup .NET
42+
uses: actions/setup-dotnet@v5
43+
with:
44+
dotnet-version: ${{ env.DOTNET_VERSION }}
45+
46+
- name: Install Android workload
47+
run: dotnet workload install android
48+
49+
- name: Restore Uno project (Android TFM only)
50+
# NOTE: 'dotnet restore' has no -f|--framework option (-f means --force there, unlike
51+
# 'dotnet build'). Use the MSBuild property directly to scope restore to one TFM.
52+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.AndroidTargetFramework }}
53+
54+
- name: Build Uno project (Android TFM only)
55+
run: >
56+
dotnet build ${{ env.UnoProjectFile }}
57+
-f ${{ env.AndroidTargetFramework }}
58+
--configuration ${{ env.DOTNET_CONFIGURATION }}
59+
--no-restore
60+
61+
ios-maccatalyst:
62+
# iOS and Mac Catalyst builds both require Xcode, which is only available on macOS runners.
63+
runs-on: macos-latest
64+
steps:
65+
- name: Checkout Repository
66+
uses: actions/checkout@v7
67+
68+
- name: Setup .NET
69+
uses: actions/setup-dotnet@v5
70+
with:
71+
dotnet-version: ${{ env.DOTNET_VERSION }}
72+
73+
- name: Install iOS and Mac Catalyst workloads
74+
run: dotnet workload install ios maccatalyst
75+
76+
- name: Restore Uno project (iOS TFM only)
77+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.iOSTargetFramework }}
78+
79+
- name: Build Uno project (iOS TFM only)
80+
run: >
81+
dotnet build ${{ env.UnoProjectFile }}
82+
-f ${{ env.iOSTargetFramework }}
83+
--configuration ${{ env.DOTNET_CONFIGURATION }}
84+
--no-restore
85+
86+
- name: Restore Uno project (Mac Catalyst TFM only)
87+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.MacCatalystTargetFramework }}
88+
89+
- name: Build Uno project (Mac Catalyst TFM only)
90+
run: >
91+
dotnet build ${{ env.UnoProjectFile }}
92+
-f ${{ env.MacCatalystTargetFramework }}
93+
--configuration ${{ env.DOTNET_CONFIGURATION }}
94+
--no-restore
95+
96+
windows:
97+
runs-on: windows-latest
98+
steps:
99+
- name: Checkout Repository
100+
uses: actions/checkout@v7
101+
102+
- name: Setup .NET
103+
uses: actions/setup-dotnet@v5
104+
with:
105+
dotnet-version: ${{ env.DOTNET_VERSION }}
106+
107+
- name: Restore Uno project (Windows TFM only)
108+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.WindowsTargetFramework }}
109+
110+
- name: Build Uno project (Windows TFM only)
111+
run: >
112+
dotnet build ${{ env.UnoProjectFile }}
113+
-f ${{ env.WindowsTargetFramework }}
114+
--configuration ${{ env.DOTNET_CONFIGURATION }}
115+
--no-restore
116+
117+
browserwasm:
118+
runs-on: ubuntu-latest
119+
steps:
120+
- name: Checkout Repository
121+
uses: actions/checkout@v7
122+
123+
- name: Setup .NET
124+
uses: actions/setup-dotnet@v5
125+
with:
126+
dotnet-version: ${{ env.DOTNET_VERSION }}
127+
128+
- name: Install WebAssembly build tools workload
129+
run: dotnet workload install wasm-tools
130+
131+
- name: Restore Uno project (Browser WebAssembly TFM only)
132+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.BrowserWasmTargetFramework }}
133+
134+
- name: Build Uno project (Browser WebAssembly TFM only)
135+
run: >
136+
dotnet build ${{ env.UnoProjectFile }}
137+
-f ${{ env.BrowserWasmTargetFramework }}
138+
--configuration ${{ env.DOTNET_CONFIGURATION }}
139+
--no-restore
140+
141+
desktop:
142+
# NOTE: this head (along with every other head in this file) currently fails to restore
143+
# with NU1605 - see the file-level NOTE above and #506. #506 originally reported the NU1903
144+
# Tmds.DBus audit warning for this head specifically; that warning alone is harmless (this
145+
# repo does not configure NuGet audit to fail on warnings), but the NU1605 uncovered while
146+
# investigating it turned out to be project-wide, not desktop-specific.
147+
runs-on: ubuntu-latest
148+
steps:
149+
- name: Checkout Repository
150+
uses: actions/checkout@v7
151+
152+
- name: Setup .NET
153+
uses: actions/setup-dotnet@v5
154+
with:
155+
dotnet-version: ${{ env.DOTNET_VERSION }}
156+
157+
- name: Restore Uno project (Desktop TFM only)
158+
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.DesktopTargetFramework }}
159+
160+
- name: Build Uno project (Desktop TFM only)
161+
run: >
162+
dotnet build ${{ env.UnoProjectFile }}
163+
-f ${{ env.DesktopTargetFramework }}
164+
--configuration ${{ env.DOTNET_CONFIGURATION }}
165+
--no-restore

.github/workflows/build-samples-todoapp-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ env:
1414
WpfProjectFile: 'samples/todoapp/TodoApp.WPF/TodoApp.WPF.csproj'
1515
# TodoApp.MAUI.csproj targets net10.0-android;net10.0-ios, with net10.0-windows10.0.19041.0
1616
# conditionally appended only when building on Windows. Android/iOS heads require separate
17-
# workloads and are tracked in https://github.com/CommunityToolkit/Datasync/issues/511 (Phase 3),
18-
# so restore/build here is explicitly scoped to the Windows TargetFramework only.
17+
# workloads and are built by build-samples-todoapp-maui.yml instead, so restore/build here is
18+
# explicitly scoped to the Windows TargetFramework only.
1919
MauiProjectFile: 'samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj'
2020
MauiWindowsTargetFramework: 'net10.0-windows10.0.19041.0'
2121

.github/workflows/build-samples.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,23 @@ jobs:
3434
todoapp-windows:
3535
uses: ./.github/workflows/build-samples-todoapp-windows.yml
3636

37+
todoapp-maui:
38+
uses: ./.github/workflows/build-samples-todoapp-maui.yml
39+
40+
# NOTE: todoapp-uno (build-samples-todoapp-uno.yml) is intentionally NOT wired in here.
41+
# TodoApp.Uno.csproj fails to restore on every head with:
42+
# NU1605: Detected package downgrade: Uno.WinUI from 5.5.87 to 5.4.22
43+
# TodoApp.Uno -> CommunityToolkit.WinUI.Behaviors 8.2.250402 -> Uno.WinUI (>= 5.5.87)
44+
# TodoApp.Uno -> Uno.WinUI (>= 5.4.22)
45+
# This is unconditional (CommunityToolkit.WinUI.Behaviors has no TFM condition on its
46+
# PackageReference), so it blocks every TFM, not just the desktop head as originally
47+
# suspected. See https://github.com/CommunityToolkit/Datasync/issues/506, which is tracking
48+
# the underlying Uno.WinUI/CommunityToolkit.WinUI.Behaviors version conflict. Re-enable this
49+
# job (add it back to the jobs list and to all-samples-built's needs below) once #506 is
50+
# resolved and TodoApp.Uno.csproj restores cleanly.
51+
3752
# Single aggregation point so branch protection only needs to require one check,
38-
# regardless of how many sample workflows are added over time (see Phase 3
39-
# follow-up: https://github.com/CommunityToolkit/Datasync/issues/511).
53+
# regardless of how many sample workflows are added over time.
4054
all-samples-built:
4155
name: All samples built
4256
if: always()
@@ -48,6 +62,7 @@ jobs:
4862
- todoapp-tutorial
4963
- todoapp-avalonia
5064
- todoapp-windows
65+
- todoapp-maui
5166
runs-on: ubuntu-latest
5267
steps:
5368
- name: Check sample build results

samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.iOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>LSRequiresIPhoneOS</key>
1414
<true/>
1515
<key>MinimumOSVersion</key>
16-
<string>13.0</string>
16+
<string>15.0</string>
1717
<key>UIDeviceFamily</key>
1818
<array>
1919
<integer>1</integer>

0 commit comments

Comments
 (0)