Skip to content

Commit 9de1d5b

Browse files
jhaygood86eXpl0it3r
authored andcommitted
Fix CI: build a cross-platform solution filter on non-Windows runners
HtmlRenderer.WinUI/HtmlRenderer.Demo.WinUI depend on the Windows App SDK's MSIX PRI-generation step, which shells out to native Windows x86 binaries (makepri.exe/makeappx.exe) - unlike the WinForms/WPF adapters, which cross-compile cleanly everywhere via EnableWindowsTargeting's reference- assembly story, there is no non-Windows equivalent for those native tools at all ("Exec format error" on Ubuntu/macOS). Adds Source/HtmlRenderer.CrossPlatform.slnf, excluding just those two projects, and has the workflow build the full .sln on Windows but the filtered one everywhere else - every other project (including the WinUI adapter's own test-relevant siblings) still builds and tests identically on all three OSes.
1 parent fcf0125 commit 9de1d5b

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,23 @@ jobs:
4545
- name: Verify SDK Installation
4646
run: dotnet --info
4747

48+
- name: Select build target
49+
id: build-target
50+
run: |
51+
# HtmlRenderer.WinUI/HtmlRenderer.Demo.WinUI (Windows App SDK/Win2D, MSIX PRI generation via
52+
# native makepri.exe/makeappx.exe) can only build on Windows - unlike the WinForms/WPF adapters,
53+
# which cross-compile cleanly everywhere via EnableWindowsTargeting's reference-assembly story,
54+
# there is no non-Windows equivalent for those native tools at all. Non-Windows runners build a
55+
# solution filter excluding just those two projects; everything else still builds and tests
56+
# identically on every OS.
57+
$target = $IsWindows ? "Source/HtmlRenderer.sln" : "Source/HtmlRenderer.CrossPlatform.slnf"
58+
echo "path=$target" >> $env:GITHUB_OUTPUT
59+
4860
- name: Restore Dependencies
49-
run: dotnet restore Source/HtmlRenderer.sln
61+
run: dotnet restore ${{ steps.build-target.outputs.path }}
5062

5163
- name: Build
52-
run: dotnet build Source/HtmlRenderer.sln --configuration Release --no-restore
64+
run: dotnet build ${{ steps.build-target.outputs.path }} --configuration Release --no-restore
5365

5466
- name: Run Tests
5567
if: runner.os == 'Windows'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"solution": {
3+
"path": "HtmlRenderer.sln",
4+
"projects": [
5+
"Demo\\Common\\HtmlRenderer.Demo.Common.csproj",
6+
"Demo\\WinForms\\HtmlRenderer.Demo.WinForms.csproj",
7+
"Demo\\WPF\\HtmlRenderer.Demo.WPF.csproj",
8+
"HtmlRenderer\\HtmlRenderer.csproj",
9+
"HtmlRenderer.PdfSharp\\HtmlRenderer.PdfSharp.csproj",
10+
"HtmlRenderer.WinForms\\HtmlRenderer.WinForms.csproj",
11+
"HtmlRenderer.WPF\\HtmlRenderer.WPF.csproj",
12+
"Test\\HtmlRenderer.IntegrationTest\\HtmlRenderer.IntegrationTest.csproj",
13+
"Test\\HtmlRenderer.PdfSharp.Test\\HtmlRenderer.PdfSharp.Test.csproj",
14+
"Test\\HtmlRenderer.Test\\HtmlRenderer.Test.csproj"
15+
]
16+
}
17+
}

0 commit comments

Comments
 (0)