@@ -58,17 +58,38 @@ jobs:
5858 -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
5959 -p:StridePlatforms=Windows `
6060 -p:StrideGraphicsApis=Direct3D11
61+ - name : Start screenshot watchdog
62+ shell : pwsh
63+ run : |
64+ Start-Job -Name ScreenshotWatchdog -ScriptBlock {
65+ Add-Type -AssemblyName System.Windows.Forms
66+ while ($true) {
67+ Start-Sleep -Seconds 30
68+ try {
69+ $bitmap = [System.Drawing.Bitmap]::new([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width, [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height)
70+ [System.Drawing.Graphics]::FromImage($bitmap).CopyFromScreen(0, 0, 0, 0, $bitmap.Size)
71+ $bitmap.Save("$env:GITHUB_WORKSPACE\screenshot.png")
72+ } catch {}
73+ }
74+ }
6175 - name : Test
76+ timeout-minutes : 20
6277 run : |
6378 dotnet test build\Stride.Tests.Game.slnf `
6479 --no-build `
6580 -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
81+ - name : Stop screenshot watchdog
82+ if : always()
83+ shell : pwsh
84+ run : Get-Job -Name ScreenshotWatchdog -ErrorAction SilentlyContinue | Stop-Job -PassThru | Remove-Job
6685 - name : Upload test artifacts
6786 if : always()
6887 uses : actions/upload-artifact@v4
6988 with :
7089 name : test-artifacts-game-common
71- path : tests/local/
90+ path : |
91+ tests/local/
92+ screenshot.png
7293 if-no-files-found : ignore
7394
7495 #
@@ -146,13 +167,32 @@ jobs:
146167 -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
147168 -p:StridePlatforms=Windows `
148169 -p:StrideGraphicsApis=${{ matrix.graphics-api }}
170+ - name : Start screenshot watchdog
171+ shell : pwsh
172+ run : |
173+ Start-Job -Name ScreenshotWatchdog -ScriptBlock {
174+ Add-Type -AssemblyName System.Windows.Forms
175+ while ($true) {
176+ Start-Sleep -Seconds 30
177+ try {
178+ $bitmap = [System.Drawing.Bitmap]::new([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width, [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height)
179+ [System.Drawing.Graphics]::FromImage($bitmap).CopyFromScreen(0, 0, 0, 0, $bitmap.Size)
180+ $bitmap.Save("$env:GITHUB_WORKSPACE\screenshot.png")
181+ } catch {}
182+ }
183+ }
149184 - name : Test
185+ timeout-minutes : 20
150186 run : |
151187 dotnet test build\Stride.Tests.Game.GPU.slnf `
152188 --no-build `
153189 -p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
154190 -p:StrideGraphicsApis=${{ matrix.graphics-api }} `
155191 -- RunConfiguration.MaxCpuCount=1
192+ - name : Stop screenshot watchdog
193+ if : always()
194+ shell : pwsh
195+ run : Get-Job -Name ScreenshotWatchdog -ErrorAction SilentlyContinue | Stop-Job -PassThru | Remove-Job
156196 - name : Collect symbols for crash analysis
157197 if : always()
158198 shell : pwsh
@@ -172,4 +212,5 @@ jobs:
172212 path : |
173213 tests/local/
174214 crash-dumps/
215+ screenshot.png
175216 if-no-files-found : ignore
0 commit comments