Skip to content

Commit 7c2b950

Browse files
committed
feat(ci): validate replays for mismatches
1 parent d8af372 commit 7c2b950

12 files changed

+100
-3
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ jobs:
4141
generalsmd:
4242
- 'GeneralsMD/**'
4343
shared:
44-
- '.github/workflows/build-toolchain.yml'
45-
- '.github/workflows/ci.yml'
44+
- '.github/workflows/**'
4645
- 'CMakeLists.txt'
4746
- 'CMakePresets.json'
4847
- 'cmake/**'
@@ -125,6 +124,9 @@ jobs:
125124
- preset: "win32-debug"
126125
tools: true
127126
extras: true
127+
- preset: "win32-debuglog"
128+
tools: true
129+
extras: true
128130
# vcpkg builds have been disabled for now due to excessive build times of 30 minutes per preset
129131
# - preset: "win32-vcpkg"
130132
# tools: true
@@ -143,3 +145,59 @@ jobs:
143145
tools: ${{ matrix.tools }}
144146
extras: ${{ matrix.extras }}
145147
secrets: inherit
148+
149+
replay-test:
150+
name: Replay Compatibility Test${{ matrix.preset && '' }}
151+
needs: build-generalsmd
152+
if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.generalsmd == 'true' || needs.detect-changes.outputs.shared == 'true' }}
153+
runs-on: windows-latest
154+
strategy:
155+
matrix:
156+
include:
157+
- preset: "win32"
158+
- preset: "win32-profile"
159+
- preset: "win32-debug"
160+
steps:
161+
- name: Checkout Code
162+
uses: actions/checkout@v4
163+
- name: Download Game Artifact
164+
uses: actions/download-artifact@v4
165+
with:
166+
name: GeneralsMD-${{ matrix.preset }}+t+e
167+
path: build
168+
- name: Run Replay Compatibility Tests
169+
shell: pwsh
170+
run: |
171+
$exePath = "build\generalszh.exe"
172+
$replayPattern = "GeneralsMD\Replays\*.rep"
173+
$args = "-jobs", "2", "-headless", "-replay", "$replayPattern"
174+
175+
Write-Host "Checking if executable exists at: $exePath"
176+
if (-not (Test-Path $exePath)) {
177+
Write-Host "ERROR: Executable not found at $exePath"
178+
exit 1
179+
}
180+
181+
$commandLine = "$exePath $($args -join ' ')"
182+
Write-Host "Running: $commandLine"
183+
184+
try {
185+
& $exePath @args
186+
if (-not $?) {
187+
Write-Host "ERROR: Process failed to start or exited with an error."
188+
exit 1
189+
}
190+
191+
$exitCode = $LASTEXITCODE
192+
if ($null -eq $exitCode) {
193+
Write-Host "WARNING: Process did not return an exit code. Assuming failure."
194+
exit 1
195+
}
196+
197+
Write-Host "Process exited with code $exitCode"
198+
exit $exitCode
199+
} catch {
200+
Write-Host "ERROR: Exception occurred while running the process."
201+
Write-Host $_
202+
exit 1
203+
}

CMakePresets.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@
119119
"RTS_BUILD_OPTION_DEBUG": "ON"
120120
}
121121
},
122+
{
123+
"name": "win32-debuglog",
124+
"inherits": "win32",
125+
"displayName": "Windows 32bit Debug Logging",
126+
"cacheVariables": {
127+
"RTS_DEBUG_LOGGING": "ON",
128+
"RTS_DEBUG_CRASHING": "ON"
129+
}
130+
},
122131
{
123132
"name": "win32-vcpkg",
124133
"inherits": "default-vcpkg",
@@ -221,6 +230,13 @@
221230
"description": "Build Windows 32bit Debug",
222231
"configuration": "Debug"
223232
},
233+
{
234+
"name": "win32-debuglog",
235+
"configurePreset": "win32-debuglog",
236+
"displayName": "Build Windows 32bit Debug Logging",
237+
"description": "Build Windows 32bit Debug Logging",
238+
"configuration": "Debug"
239+
},
224240
{
225241
"name": "win32-vcpkg",
226242
"configurePreset": "win32-vcpkg",
@@ -362,6 +378,19 @@
362378
}
363379
]
364380
},
381+
{
382+
"name": "win32-debuglog",
383+
"steps": [
384+
{
385+
"type": "configure",
386+
"name": "win32-debuglog"
387+
},
388+
{
389+
"type": "build",
390+
"name": "win32-debuglog"
391+
}
392+
]
393+
},
365394
{
366395
"name": "win32-vcpkg",
367396
"steps": [
@@ -428,4 +457,4 @@
428457
]
429458
}
430459
]
431-
}
460+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

GeneralsMD/Replays/366648.rep

70.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)