5151 matrix :
5252 platform : [WinUI2, WinUI3]
5353
54+ env :
55+ # faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
56+ TARGET_PLATFORMS : ${{ matrix.platform != 'WinUI3' && 'all' || 'all-uwp' }}
57+ TEST_PLATFORM : ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}
58+
5459 # Steps represent a sequence of tasks that will be executed as part of the job
5560 steps :
5661 - name : Install .NET 6 SDK
@@ -72,12 +77,13 @@ jobs:
7277 - name : Add msbuild to PATH
73787479
75- - name : Enable all TargetFrameworks
80+ - name : Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
7681 working-directory : ./common/Scripts/
77- run : powershell -version 5.1 -command "./UseTargetFrameworks.ps1 all " -ErrorAction Stop
82+ run : powershell -version 5.1 -command "./UseTargetFrameworks.ps1 ${{ env.TARGET_PLATFORMS }} " -ErrorAction Stop
7883
79- - name : Generate solution
80- run : powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
84+ - name : Generate solution w/ ${{ env.TEST_PLATFORM }} Tests
85+ working-directory : ./
86+ run : powershell -version 5.1 -command "./common/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}" -ErrorAction Stop
8187
8288 - name : Enable Uno.WinUI (in WinUI3 matrix only)
8389 working-directory : ./common/Scripts/
@@ -94,11 +100,11 @@ jobs:
94100
95101 # Push Packages to our DevOps Artifacts Feed
96102 - name : Add source
97- if : ${{github.ref == 'refs/heads/main'}}
103+ if : ${{ github.ref == 'refs/heads/main' }}
98104 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 }}
99105
100106 - name : Push packages
101- if : ${{github.ref == 'refs/heads/main'}}
107+ if : ${{ github.ref == 'refs/heads/main' }}
102108 run : dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
103109
104110 # Run tests
@@ -114,18 +120,21 @@ jobs:
114120 id : test-generator
115121 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"
116122
117- - name : Run experiment tests against UWP
118- id : test-uwp
119- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
120-
121- - name : Run experiment tests against WinAppSDK
122- id : test-winappsdk
123- run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
123+ - name : Run experiment tests against ${{ env.TEST_PLATFORM }}
124+ id : test-platform
125+ run : vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"
124126
125127 - name : Create test reports
126128 run : |
127129 testspace '[${{ matrix.platform }}]./TestResults/*.trx'
128- if : ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
130+ if : ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}
131+
132+ # - name: Artifact - Slngen Logs
133+ # uses: actions/upload-artifact@v3
134+ # if: success() || failure()
135+ # with:
136+ # name: slngen-logs
137+ # path: ./**/slngen.*log
129138
130139 # Test job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
131140 new-experiment :
@@ -199,9 +208,14 @@ jobs:
199208 - name : Checkout Repository
200209 uses : actions/checkout@v3
201210
211+ # Restore Tools from Manifest list in the Repository
212+ - name : Restore dotnet tools
213+ run : dotnet tool restore
214+
202215 - name : Generate solution
203216 shell : pwsh
204- run : ./GenerateAllSolution.ps1
217+ working-directory : ./
218+ run : ./common/GenerateAllSolution.ps1
205219
206220 - name : Install ninja for WASM native dependencies
207221 run : sudo apt-get install ninja-build
@@ -213,3 +227,10 @@ jobs:
213227 run : dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
214228
215229 # TODO: Do we want to run tests here? Can we do that on linux easily?
230+
231+ # - name: Artifact - Slngen Logs
232+ # uses: actions/upload-artifact@v3
233+ # if: success() || failure()
234+ # with:
235+ # name: slngen-logs
236+ # path: ./**/slngen.*log
0 commit comments