@@ -40,84 +40,14 @@ jobs:
4040 - name : Check XAML Styling
4141 run : powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
4242
43- # This workflow contains a single job called "Build-WinUI-2"
44- Build-WinUI-2 :
43+ # Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
44+ build :
4545 needs : [Xaml-Style-Check]
4646 runs-on : windows-latest
4747
48- # Steps represent a sequence of tasks that will be executed as part of the job
49- steps :
50- - name : Install .NET 6 SDK
51- uses : actions/setup-dotnet@v3
52- with :
53- dotnet-version : ' 6.0.x'
54-
55- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
56- - name : Checkout Repository
57- uses : actions/checkout@v3
58-
59- # Restore Tools from Manifest list in the Repository
60- - name : Restore dotnet tools
61- run : dotnet tool restore
62-
63- - name : Run Uno Check to Install Dependencies
64- run : dotnet tool run uno-check --ci --fix --non-interactive --skip wsl --skip androidemulator --verbose
65-
66- - name : Add msbuild to PATH
67- 68-
69- - name : Enable all TargetFrameworks
70- working-directory : ./common/Scripts/
71- run : powershell -version 5.1 -command "./UseTargetFrameworks.ps1 all" -ErrorAction Stop
72-
73- - name : Generate solution
74- run : powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
75-
76- - name : MSBuild
77- # working-directory: ./
78- run : msbuild.exe Toolkit.Labs.All.sln /restore -p:Configuration=Release
79-
80- # Build All Packages
81- - name : pack experiments
82- working-directory : ./common/Scripts/
83- run : ./PackEachExperiment.ps1 all
84-
85- # Push Packages to our DevOps Artifacts Feed
86- - name : Add source
87- if : ${{github.ref == 'refs/heads/main'}}
88- 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 }}
89-
90- - name : Push packages
91- if : ${{github.ref == 'refs/heads/main'}}
92- run : dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
93-
94- # Run tests
95- - name : Setup VSTest Path
96- uses : darenm/Setup-VSTest@v1
97-
98- - name : Install Testspace Module
99- uses : testspace-com/setup-testspace@v1
100- with :
101- domain : ${{ github.repository_owner }}
102-
103- - name : Run SourceGenerators tests
104- 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"
105-
106- - name : Run experiment tests against UWP
107- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
108-
109- - name : Run experiment tests against WinAppSDK
110- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
111-
112- - name : Create test reports
113- run : |
114- testspace '[WinUI2]./TestResults/*.trx'
115- if : always()
116-
117- # This workflow contains a single job called "Build-WinUI-3"
118- Build-WinUI-3 :
119- needs : [Xaml-Style-Check]
120- runs-on : windows-latest
48+ strategy :
49+ matrix :
50+ platform : [WinUI2, WinUI3]
12151
12252 # Steps represent a sequence of tasks that will be executed as part of the job
12353 steps :
@@ -150,9 +80,10 @@ jobs:
15080 - name : Enable WinUI 3
15181 working-directory : ./common/Scripts/
15282 run : powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
83+ if : ${{ matrix.platform == 'WinUI3' }}
15384
15485 - name : MSBuild
155- # working-directory: ./
86+ # working-directory: ./
15687 run : msbuild.exe Toolkit.Labs.All.sln /restore /nowarn:MSB4011 -p:Configuration=Release
15788
15889 # Build All Packages
@@ -179,21 +110,24 @@ jobs:
179110 domain : ${{ github.repository_owner }}
180111
181112 - name : Run SourceGenerators tests
113+ id : test-generator
182114 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"
183115
184116 - name : Run experiment tests against UWP
117+ id : test-uwp
185118 run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
186119
187120 - name : Run experiment tests against WinAppSDK
121+ id : test-winappsdk
188122 run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
189123
190124 - name : Create test reports
191125 run : |
192- testspace '[WinUI3 ]./TestResults/*.trx'
193- if : always()
126+ testspace '[${{ matrix.platform }} ]./TestResults/*.trx'
127+ if : ${{ always() && (steps.test-generator.status == 'completed' || steps.test-uwp.status == 'completed' || steps.test-winappsdk.status == 'completed') }}
194128
195- # Test/temp job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
196- experiment :
129+ # Test job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
130+ new- experiment :
197131 needs : [Xaml-Style-Check]
198132 runs-on : windows-latest
199133
@@ -238,15 +172,17 @@ jobs:
238172 domain : ${{ github.repository_owner }}
239173
240174 - name : Run tests in the generated experiment against UWP
175+ id : test-uwp
241176 run : vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpUWP.trx"
242177
243178 - name : Run tests in the generated experiment against WinAppSDK
179+ id : test-winappsdk
244180 run : vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpWinAppSdk.trx"
245181
246182 - name : Create test reports
247183 run : |
248184 testspace '[New Experiment]./TestResults/*.trx'
249- if : always()
185+ if : ${{ always() && (steps.test-uwp.status == 'completed' || steps.test-winappsdk.status == 'completed') }}
250186
251187 wasm-linux :
252188 needs : [Xaml-Style-Check]
0 commit comments