Skip to content

Commit 4841a31

Browse files
committed
fix(ci): Move replay files to correct location, adjust exe call
1 parent 7c2b950 commit 4841a31

File tree

2 files changed

+16
-35
lines changed

2 files changed

+16
-35
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -165,39 +165,30 @@ jobs:
165165
with:
166166
name: GeneralsMD-${{ matrix.preset }}+t+e
167167
path: build
168+
- name: Move Replay files to correct folder
169+
shell: pwsh
170+
run: |
171+
$source = "GeneralsMD\Replays"
172+
$destination = "$env:USERPROFILE\Documents\Command and Conquer Generals Zero Hour\Replays"
173+
174+
New-Item -ItemType Directory -Path $destination -Force | Out-Null
175+
Get-ChildItem -Path $source -File | Move-Item -Destination $destination
168176
- name: Run Replay Compatibility Tests
169177
shell: pwsh
170178
run: |
171179
$exePath = "build\generalszh.exe"
172-
$replayPattern = "GeneralsMD\Replays\*.rep"
173-
$args = "-jobs", "2", "-headless", "-replay", "$replayPattern"
174180
175181
Write-Host "Checking if executable exists at: $exePath"
176182
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."
183+
Write-Host "ERROR: Executable not found at $exePath"
188184
exit 1
189-
}
185+
}
190186
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-
}
187+
$process = Start-Process -FilePath $exePath -ArgumentList "-jobs 2 -headless" -Wait -PassThru
188+
$exitCode = $process.ExitCode
196189
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
190+
# Handle non-zero exit code
191+
if ($exitCode -ne 0) {
192+
Write-Host "Process failed with exit code $exitCode"
193+
throw "Executable failed with exit code $exitCode"
203194
}

GeneralsMD/Replays/replay_list.csv

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)