Skip to content

Commit 8a8b288

Browse files
committed
Expand matrix to build each winui/multitarget separately
1 parent c532c11 commit 8a8b288

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@ jobs:
6161

6262
# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
6363
strategy:
64-
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
64+
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
6565
matrix:
66-
platform: [WinUI2, WinUI3]
66+
winui: [2, 3]
67+
multitarget: ['uwp', 'wasdk', 'wasm', 'wpf', 'linuxgtk', 'macos', 'ios', 'android']
68+
exclude:
69+
- winui: 2
70+
multitarget: wasdk
71+
- winui: 3
72+
multitarget: uwp
6773

6874
env:
69-
# faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
70-
TARGET_PLATFORMS: ${{ matrix.platform != 'WinUI3' && 'all-wasdk' || 'all-uwp' }}
71-
TEST_PLATFORM: ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}
7275
VERSION_PROPERTY: ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
7376

7477
# Steps represent a sequence of tasks that will be executed as part of the job
@@ -124,18 +127,17 @@ jobs:
124127
with:
125128
vs-version: '[17.9,)'
126129

127-
- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
130+
- name: Enable ${{ matrix.multitarget }} TargetFrameworks
128131
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
129-
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 ${{ env.TARGET_PLATFORMS }}" -ErrorAction Stop
130-
131-
- name: Generate solution w/ ${{ env.TEST_PLATFORM }} Tests
132-
working-directory: ./
133-
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
132+
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 -Include ${{ matrix.multitarget }}" -ErrorAction Stop
134133

135-
- name: Enable Uno.WinUI (in WinUI3 matrix only)
136-
if: ${{ matrix.platform == 'WinUI3' }}
134+
- name: Set WinUI Version
137135
working-directory: ./${{ env.MULTI_TARGET_DIRECTORY }}
138-
run: powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
136+
run: powershell -version 5.1 -command "./UseUnoWinUI.ps1 ${{ matrix.winui }}" -ErrorAction Stop
137+
138+
- name: Generate solution with ${{ matrix.multitarget }} gallery and tests
139+
working-directory: ./
140+
run: powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ matrix.multitarget }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
139141

140142
- name: Format Date/Time of Commit for Package Version
141143
if: ${{ env.IS_RELEASE == 'false' }}
@@ -189,9 +191,10 @@ jobs:
189191
id: test-generator
190192
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net6.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
191193

192-
- name: Run experiment tests against ${{ env.TEST_PLATFORM }}
194+
- name: Run experiment tests against ${{ matrix.multitarget }}
195+
if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
193196
id: test-platform
194-
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx" /Blame
197+
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
195198

196199
- name: Create test reports
197200
run: |

0 commit comments

Comments
 (0)