|
17 | 17 |
|
18 | 18 | env:
|
19 | 19 | DOTNET_VERSION: ${{ '8.0.x' }}
|
20 |
| - ENABLE_DIAGNOSTICS: false |
| 20 | + ENABLE_DIAGNOSTICS: true |
21 | 21 | #COREHOST_TRACE: 1
|
22 | 22 | COREHOST_TRACEFILE: corehosttrace.log
|
23 | 23 |
|
@@ -153,6 +153,44 @@ jobs:
|
153 | 153 | minimum-size: 32GB
|
154 | 154 | maximum-size: 32GB
|
155 | 155 | disk-root: "C:"
|
| 156 | + |
| 157 | + - name: Enable Crash Dumps |
| 158 | + if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }} |
| 159 | + shell: pwsh |
| 160 | + run: | |
| 161 | + # If we set the registry from a 32-bit process on a 64-bit machine, we will set the "virtualized" syswow registry. |
| 162 | + # For crash dump collection we always want to set the "native" registry, so we make sure to invoke the native cmd.exe |
| 163 | + $nativeCmdPath = "$env:SystemRoot\system32\cmd.exe" |
| 164 | + if([Environment]::Is64BitOperatingSystem -and ![Environment]::Is64BitProcess) |
| 165 | + { |
| 166 | + # The "sysnative" path is a 'magic' path that allows a 32-bit process to invoke the native 64-bit cmd.exe. |
| 167 | + $nativeCmdPath = "$env:SystemRoot\sysnative\cmd.exe" |
| 168 | + } |
| 169 | + |
| 170 | + if(!$dumpFolder) |
| 171 | + { |
| 172 | + $dumpFolder = "C:\dumps" |
| 173 | + } |
| 174 | + |
| 175 | + function Enable-CrashDumpsForProcesses { |
| 176 | + Param([string[]]$namesOfProcessesForDumpCollection) |
| 177 | + |
| 178 | + foreach($procName in $namesOfProcessesForDumpCollection ) |
| 179 | + { |
| 180 | + Write-Host "Enabling local crash dumps for $procName" |
| 181 | + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpFolder /t REG_EXPAND_SZ /d $dumpFolder /f |
| 182 | + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpType /t REG_DWORD /d 2 /f |
| 183 | + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpCount /t REG_DWORD /d 3 /f |
| 184 | + } |
| 185 | + } |
| 186 | + |
| 187 | + # enable dump collection for our test apps: |
| 188 | + $namesOfProcessesForDumpCollection = @( |
| 189 | + "CommunityToolkit.Tests.Uwp.exe", |
| 190 | + "CommunityToolkit.Tests.WinAppSdk.exe", |
| 191 | + "VSTest.Console.exe") |
| 192 | + |
| 193 | + Enable-CrashDumpsForProcesses $namesOfProcessesForDumpCollection |
156 | 194 |
|
157 | 195 | - name: Install .NET SDK v${{ env.DOTNET_VERSION }}
|
158 | 196 | uses: actions/setup-dotnet@v4
|
@@ -235,6 +273,13 @@ jobs:
|
235 | 273 | name: new-experiment-logs
|
236 | 274 | path: ./**/*.*log
|
237 | 275 |
|
| 276 | + - name: Artifact - Process Dumps |
| 277 | + uses: actions/upload-artifact@v4 |
| 278 | + if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }} |
| 279 | + with: |
| 280 | + name: new-experiment-dumps |
| 281 | + path: C:/dumps/*.*dmp |
| 282 | + |
238 | 283 | wasm-linux:
|
239 | 284 | runs-on: ubuntu-latest
|
240 | 285 | env:
|
|
0 commit comments