@@ -24,11 +24,10 @@ jobs:
24
24
25
25
# Steps represent a sequence of tasks that will be executed as part of the job
26
26
steps :
27
- # Needed until XAML Styler updates to .NET 6
28
- - name : Install .NET Core 3.1 SDK
27
+ - name : Install .NET 6 SDK
29
28
uses : actions/setup-dotnet@v1
30
29
with :
31
- dotnet-version : ' 3.1 .x'
30
+ dotnet-version : ' 6.0 .x'
32
31
33
32
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
34
33
- name : Checkout Repository
@@ -41,84 +40,16 @@ jobs:
41
40
- name : Check XAML Styling
42
41
run : powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
43
42
44
- # This workflow contains a single job called "Build-WinUI-2"
45
- Build-WinUI-2 :
43
+ # Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
44
+ build :
46
45
needs : [Xaml-Style-Check]
47
46
runs-on : windows-latest
48
47
49
- # Steps represent a sequence of tasks that will be executed as part of the job
50
- steps :
51
- - name : Install .NET 6 SDK
52
- uses : actions/setup-dotnet@v1
53
- with :
54
- dotnet-version : ' 6.0.202'
55
-
56
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
57
- - name : Checkout Repository
58
- uses : actions/checkout@v2
59
-
60
- # Restore Tools from Manifest list in the Repository
61
- - name : Restore dotnet tools
62
- run : dotnet tool restore
63
-
64
- - name : Run Uno Check to Install Dependencies
65
- run : dotnet tool run uno-check --ci --fix --non-interactive --skip wsl --skip androidemulator --verbose
66
-
67
- - name : Add msbuild to PATH
68
-
69
-
70
- - name : Enable all TargetFrameworks
71
- working-directory : ./common/Scripts/
72
- run : powershell -version 5.1 -command "./UseTargetFrameworks.ps1 all" -ErrorAction Stop
73
-
74
- - name : Generate solution
75
- run : powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
76
-
77
- - name : MSBuild
78
- # working-directory: ./
79
- run : msbuild.exe Toolkit.Labs.All.sln /restore -p:Configuration=Release
80
-
81
- # Build All Packages
82
- - name : pack experiments
83
- working-directory : ./common/Scripts/
84
- run : ./PackEachExperiment.ps1 all
85
-
86
- # Push Packages to our DevOps Artifacts Feed
87
- - name : Add source
88
- if : ${{github.ref == 'refs/heads/main'}}
89
- run : dotnet nuget add source "https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json" --name LabsFeed --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
90
-
91
- - name : Push packages
92
- if : ${{github.ref == 'refs/heads/main'}}
93
- run : dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
94
-
95
- # Run tests
96
- - name : Setup VSTest Path
97
- uses : darenm/Setup-VSTest@v1
98
-
99
- - name : Install Testspace Module
100
- uses : testspace-com/setup-testspace@v1
101
- with :
102
- domain : ${{ github.repository_owner }}
103
-
104
- - name : Run SourceGenerators tests
105
- run : vstest.console.exe ./common/CommunityToolkit.Labs.Core.SourceGenerators.Tests/CommunityToolkit.Labs.Core.SourceGenerators.Tests/bin/Release/net6.0/CommunityToolkit.Labs.Core.SourceGenerators.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
106
-
107
- - name : Run experiment tests against UWP
108
- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
109
-
110
- - name : Run experiment tests against WinAppSDK
111
- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
112
-
113
- - name : Create test reports
114
- run : |
115
- testspace '[WinUI2]./TestResults/*.trx'
116
- if : always()
117
-
118
- # This workflow contains a single job called "Build-WinUI-3"
119
- Build-WinUI-3 :
120
- needs : [Xaml-Style-Check]
121
- runs-on : windows-latest
48
+ # See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
49
+ strategy :
50
+ fail-fast : false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
51
+ matrix :
52
+ platform : [WinUI2, WinUI3]
122
53
123
54
# Steps represent a sequence of tasks that will be executed as part of the job
124
55
steps :
@@ -148,12 +79,12 @@ jobs:
148
79
- name : Generate solution
149
80
run : powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
150
81
151
- - name : Enable WinUI 3
82
+ - name : Enable Uno. WinUI (in WinUI3 matrix only)
152
83
working-directory : ./common/Scripts/
153
84
run : powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
85
+ if : ${{ matrix.platform == 'WinUI3' }}
154
86
155
87
- name : MSBuild
156
- # working-directory: ./
157
88
run : msbuild.exe Toolkit.Labs.All.sln /restore /nowarn:MSB4011 -p:Configuration=Release
158
89
159
90
# Build All Packages
@@ -180,21 +111,24 @@ jobs:
180
111
domain : ${{ github.repository_owner }}
181
112
182
113
- name : Run SourceGenerators tests
114
+ id : test-generator
183
115
run : vstest.console.exe ./common/CommunityToolkit.Labs.Core.SourceGenerators.Tests/CommunityToolkit.Labs.Core.SourceGenerators.Tests/bin/Release/net6.0/CommunityToolkit.Labs.Core.SourceGenerators.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
184
116
185
117
- name : Run experiment tests against UWP
118
+ id : test-uwp
186
119
run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
187
120
188
121
- name : Run experiment tests against WinAppSDK
122
+ id : test-winappsdk
189
123
run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
190
124
191
125
- name : Create test reports
192
126
run : |
193
- testspace '[WinUI3 ]./TestResults/*.trx'
194
- if : always()
127
+ testspace '[${{ matrix.platform }} ]./TestResults/*.trx'
128
+ if : ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
195
129
196
- # Test/temp job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
197
- experiment :
130
+ # Test job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
131
+ new- experiment :
198
132
needs : [Xaml-Style-Check]
199
133
runs-on : windows-latest
200
134
@@ -239,15 +173,17 @@ jobs:
239
173
domain : ${{ github.repository_owner }}
240
174
241
175
- name : Run tests in the generated experiment against UWP
176
+ id : test-uwp
242
177
run : vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpUWP.trx"
243
178
244
179
- name : Run tests in the generated experiment against WinAppSDK
180
+ id : test-winappsdk
245
181
run : vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpWinAppSdk.trx"
246
182
247
183
- name : Create test reports
248
184
run : |
249
185
testspace '[New Experiment]./TestResults/*.trx'
250
- if : always()
186
+ if : ${{ always() && (steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
251
187
252
188
wasm-linux :
253
189
needs : [Xaml-Style-Check]
0 commit comments