1414
1515 # Allows you to run this workflow manually from the Actions tab
1616 workflow_dispatch :
17+ merge_group :
1718
1819env :
19- DOTNET_VERSION : ${{ '7.0.x ' }}
20+ DOTNET_VERSION : ${{ '7.0.402 ' }}
2021 ENABLE_DIAGNOSTICS : false
2122 # COREHOST_TRACE: 1
23+ MSBUILD_VERBOSITY : normal
2224 COREHOST_TRACEFILE : corehosttrace.log
25+ IS_MAIN : ${{ github.ref == 'refs/heads/main' }}
26+ IS_PR : ${{ startsWith(github.ref, 'refs/pull/') }}
2327
2428# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2529jobs :
2630 # This workflow contains a single job called "Xaml-Style-Check"
2731 Xaml-Style-Check :
28- runs-on : windows-latest
32+ runs-on : windows-latest-large
2933
3034 # Steps represent a sequence of tasks that will be executed as part of the job
3135 steps :
6165 env :
6266 MULTI_TARGET_DIRECTORY : tooling/MultiTarget
6367 # faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
64- TARGET_PLATFORMS : ${{ matrix.platform != 'WinUI3' && 'all' || 'all-uwp' }}
68+ TARGET_PLATFORMS : ${{ matrix.platform != 'WinUI3' && 'all-wasdk ' || 'all-uwp' }}
6569 TEST_PLATFORM : ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}
70+ VERSION_PROPERTY : ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
6671
6772 # Steps represent a sequence of tasks that will be executed as part of the job
6873 steps :
@@ -72,16 +77,15 @@ jobs:
7277 minimum-size : 32GB
7378 maximum-size : 32GB
7479 disk-root : " C:"
75-
76- - name : Configure User-Mode crash dump type
77- if : ${{ env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '' }}
78- run : |
79- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpType /t REG_DWORD /d 2 /f
80-
81- - name : Configure User-Mode crash dump folder
80+
81+ - name : Enable User-Mode Dumps collecting
8282 if : ${{ env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '' }}
83+ shell : powershell
8384 run : |
84- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpFolder /t REG_EXPAND_SZ /d C:\CrashDumps\ /f
85+ New-Item '${{ github.workspace }}\CrashDumps' -Type Directory
86+ Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpFolder' -Type ExpandString -Value '${{ github.workspace }}\CrashDumps'
87+ Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
88+ Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'
8589
8690 - name : Install .NET SDK v${{ env.DOTNET_VERSION }}
8791 uses : actions/setup-dotnet@v3
@@ -103,7 +107,15 @@ jobs:
103107 run : dotnet tool restore
104108
105109 - name : Run Uno Check to Install Dependencies
106- run : dotnet tool run uno-check --ci --fix --non-interactive --skip wsl --skip androidemulator --verbose
110+ run : >
111+ dotnet tool run uno-check
112+ --ci
113+ --fix
114+ --non-interactive
115+ --skip wsl
116+ --skip androidemulator
117+ --skip vswinworkloads
118+ --verbose
107119
108120 - name : Add msbuild to PATH
109121@@ -117,31 +129,48 @@ jobs:
117129 run : powershell -version 5.1 -command "./tooling/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }}" -ErrorAction Stop
118130
119131 - name : Enable Uno.WinUI (in WinUI3 matrix only)
132+ if : ${{ matrix.platform == 'WinUI3' }}
120133 working-directory : ./${{ env.MULTI_TARGET_DIRECTORY }}
121134 run : powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
122- if : ${{ matrix.platform == 'WinUI3' }}
135+
136+ - name : Format Date/Time of Commit for Package Version
137+ run : |
138+ echo "VERSION_DATE=$(git log -1 --format=%cd --date=format:%y%m%d)" >> $env:GITHUB_ENV
123139
124140 - name : MSBuild (With diagnostics)
125141 if : ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
126- run : msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release /bl -v:diag
142+ run : >
143+ msbuild.exe /restore /nowarn:MSB4011
144+ /p:Configuration=Release
145+ /m
146+ ${{ env.ENABLE_DIAGNOSTICS == 'true' && '/bl' || '' }}
147+ /v:${{ env.MSBUILD_VERBOSITY }}
148+ CommunityToolkit.AllComponents.sln
127149
128150 - name : MSBuild
129151 if : ${{ env.ENABLE_DIAGNOSTICS == 'false' }}
130152 run : msbuild.exe CommunityToolkit.AllComponents.sln /restore /nowarn:MSB4011 -p:Configuration=Release
131153
132154 # Build All Packages
133- - name : pack experiments
155+ - name : Pack experiments
134156 working-directory : ./tooling/Scripts/
135- run : ./PackEachExperiment.ps1 all
157+ run : ./PackEachExperiment.ps1 -date ${{ env.VERSION_DATE }}${{ env.VERSION_PROPERTY != '' && format(' -postfix {0}', env.VERSION_PROPERTY) || '' }}
136158
137- # Push Packages to our DevOps Artifacts Feed
138- - name : Add source
139- if : ${{ github.ref == 'refs/heads/main' }}
140- run : dotnet nuget update source LabsFeed --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
159+ # Push Pull Request Packages to our DevOps Artifacts Feed (see nuget.config)
160+ - name : Push PR packages (if not fork)
161+ if : ${{ env.IS_PR == 'true' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
162+ run : |
163+ dotnet nuget add source https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-PullRequests/nuget/v3/index.json `
164+ --name PullRequests `
165+ --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
166+ dotnet nuget push "**/*.nupkg" --api-key dummy --source PullRequests --skip-duplicate
141167
142- - name : Push packages
168+ - name : Push packages (main)
143169 if : ${{ github.ref == 'refs/heads/main' }}
144- run : dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
170+ run : |
171+ dotnet nuget update source LabsFeed `
172+ --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
173+ dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
145174
146175 # Run tests
147176 - name : Setup VSTest Path
@@ -154,7 +183,7 @@ jobs:
154183
155184 - name : Run experiment tests against ${{ env.TEST_PLATFORM }}
156185 id : test-platform
157- run : vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"
186+ run : vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx" /Blame
158187
159188 - name : Create test reports
160189 run : |
@@ -174,13 +203,28 @@ jobs:
174203 with :
175204 name : ilc-repro
176205 path : ./*.zip
177-
206+
207+ # https://github.com/dorny/paths-filter#custom-processing-of-changed-files
208+ - name : Detect If any Dump Files
209+ 210+ id : filter
211+ with :
212+ list-files : shell
213+ filters : |
214+ dump:
215+ - added: '${{ github.workspace }}/CrashDumps/*.dmp'
178216 - name : Artifact - WER crash dumps
179- uses : actions/upload-artifact@v2
180- if : ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
217+ uses : actions/upload-artifact@v3
218+ if : ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
181219 with :
182- name : Crash Dumps
183- path : C:\CrashDumps\*
220+ name : CrashDumps-${{ matrix.platform }}
221+ path : ' ${{ github.workspace }}/CrashDumps'
222+
223+ - name : Analyze Dump
224+ if : ${{ steps.filter.outputs.dump == 'true' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
225+ run : |
226+ dotnet tool install --global dotnet-dump
227+ dotnet-dump analyze ${{ steps.filter.outputs.dump_files }} -c "clrstack" -c "pe -lines" -c "exit"
184228
185229 wasm-linux :
186230 runs-on : ubuntu-latest
0 commit comments