|
8 | 8 | push: |
9 | 9 | branches: |
10 | 10 | - main |
| 11 | + - ci-replays |
11 | 12 | pull_request: |
12 | 13 | branches: |
13 | 14 | - main |
@@ -62,15 +63,15 @@ jobs: |
62 | 63 | strategy: |
63 | 64 | matrix: |
64 | 65 | 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 |
74 | 75 | - preset: "win32" |
75 | 76 | tools: true |
76 | 77 | extras: true |
@@ -106,15 +107,15 @@ jobs: |
106 | 107 | strategy: |
107 | 108 | matrix: |
108 | 109 | 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 |
118 | 119 | - preset: "win32" |
119 | 120 | tools: true |
120 | 121 | extras: true |
@@ -165,39 +166,30 @@ jobs: |
165 | 166 | with: |
166 | 167 | name: GeneralsMD-${{ matrix.preset }}+t+e |
167 | 168 | 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 |
168 | 177 | - name: Run Replay Compatibility Tests |
169 | 178 | shell: pwsh |
170 | 179 | run: | |
171 | 180 | $exePath = "build\generalszh.exe" |
172 | | - $replayPattern = "GeneralsMD\Replays\*.rep" |
173 | | - $args = "-jobs", "2", "-headless", "-replay", "$replayPattern" |
174 | 181 |
|
175 | 182 | Write-Host "Checking if executable exists at: $exePath" |
176 | 183 | 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" |
188 | 185 | exit 1 |
189 | | - } |
| 186 | + } |
190 | 187 |
|
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 |
196 | 190 |
|
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" |
203 | 195 | } |
0 commit comments