Skip to content

Commit ad823d1

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

File tree

2 files changed

+35
-53
lines changed

2 files changed

+35
-53
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
push:
99
branches:
1010
- main
11+
- ci-replays
1112
pull_request:
1213
branches:
1314
- main
@@ -62,15 +63,15 @@ jobs:
6263
strategy:
6364
matrix:
6465
include:
65-
- preset: "vc6"
66-
tools: true
67-
extras: true
68-
- preset: "vc6-profile"
69-
tools: true
70-
extras: true
71-
- preset: "vc6-debug"
72-
tools: true
73-
extras: true
66+
# - preset: "vc6"
67+
# tools: true
68+
# extras: true
69+
# - preset: "vc6-profile"
70+
# tools: true
71+
# extras: true
72+
# - preset: "vc6-debug"
73+
# tools: true
74+
# extras: true
7475
- preset: "win32"
7576
tools: true
7677
extras: true
@@ -106,15 +107,15 @@ jobs:
106107
strategy:
107108
matrix:
108109
include:
109-
- preset: "vc6"
110-
tools: true
111-
extras: true
112-
- preset: "vc6-profile"
113-
tools: true
114-
extras: true
115-
- preset: "vc6-debug"
116-
tools: true
117-
extras: true
110+
# - preset: "vc6"
111+
# tools: true
112+
# extras: true
113+
# - preset: "vc6-profile"
114+
# tools: true
115+
# extras: true
116+
# - preset: "vc6-debug"
117+
# tools: true
118+
# extras: true
118119
- preset: "win32"
119120
tools: true
120121
extras: true
@@ -165,39 +166,30 @@ jobs:
165166
with:
166167
name: GeneralsMD-${{ matrix.preset }}+t+e
167168
path: build
169+
- name: Move Replay files to correct folder
170+
shell: pwsh
171+
run: |
172+
$source = "GeneralsMD\Replays"
173+
$destination = "$env:USERPROFILE\Documents\Command and Conquer Generals Zero Hour\Replays"
174+
175+
New-Item -ItemType Directory -Path $destination -Force | Out-Null
176+
Get-ChildItem -Path $source -File | Move-Item -Destination $destination
168177
- name: Run Replay Compatibility Tests
169178
shell: pwsh
170179
run: |
171180
$exePath = "build\generalszh.exe"
172-
$replayPattern = "GeneralsMD\Replays\*.rep"
173-
$args = "-jobs", "2", "-headless", "-replay", "$replayPattern"
174181
175182
Write-Host "Checking if executable exists at: $exePath"
176183
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."
184+
Write-Host "ERROR: Executable not found at $exePath"
188185
exit 1
189-
}
186+
}
190187
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-
}
188+
$process = Start-Process -FilePath $exePath -ArgumentList "-jobs 2 -headless" -Wait -PassThru
189+
$exitCode = $process.ExitCode
196190
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
191+
# Handle non-zero exit code
192+
if ($exitCode -ne 0) {
193+
Write-Host "Process failed with exit code $exitCode"
194+
throw "Executable failed with exit code $exitCode"
203195
}

GeneralsMD/Replays/replay_list.csv

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

0 commit comments

Comments
 (0)