Skip to content

Commit a091ca9

Browse files
committed
Replay Examples logs in reporter
The downstream Examples job is now the first place reviewers look when branch protection blocks a PR. It should surface the original build and install output there as well instead of only exposing a pass or fail bit. Why: The required Examples check should stay self-contained even when it only consumes a status artifact. Why: Reprinting the captured logs keeps fork pull_request failures readable without any extra GitHub API calls or privileged workflow context.
1 parent fa3afc1 commit a091ca9

1 file changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/build-nabla.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,39 @@ jobs:
230230
- name: Container – Build & Install Examples
231231
id: build-examples
232232
continue-on-error: true
233+
shell: pwsh
233234
run: |
234-
docker exec orphan `
235+
$statusDir = Join-Path $env:RUNNER_TEMP "examples-status"
236+
New-Item -ItemType Directory -Force -Path $statusDir | Out-Null
237+
238+
$buildLog = Join-Path $statusDir "build-examples.log"
239+
$installLog = Join-Path $statusDir "install-examples.log"
240+
241+
& docker exec orphan `
235242
${{ env.entry }} ${{ env.cmd }} -Command cmake --build `
236243
--preset ci-build-dynamic-${{ matrix.vendor }} `
237244
-t examples_tests\all --config ${{ matrix.config }} `
238-
-- -k 0
245+
-- -k 0 2>&1 | Tee-Object -FilePath $buildLog
246+
$buildExitCode = $LASTEXITCODE
247+
248+
if ($buildExitCode -eq 0) {
249+
& docker exec orphan `
250+
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
251+
${{ env.binary }}\examples_tests --config ${{ matrix.config }} `
252+
--prefix ${{ env.install }} 2>&1 | Tee-Object -FilePath $installLog
253+
$installExitCode = $LASTEXITCODE
254+
} else {
255+
"Skipped because the Examples build failed." | Set-Content -Path $installLog -Encoding ascii
256+
$installExitCode = 1
257+
}
239258
240-
docker exec orphan `
241-
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
242-
${{ env.binary }}\examples_tests --config ${{ matrix.config }} `
243-
--prefix ${{ env.install }}
259+
if ($buildExitCode -ne 0) {
260+
exit $buildExitCode
261+
}
262+
263+
if ($installExitCode -ne 0) {
264+
exit $installExitCode
265+
}
244266
245267
- name: Record Examples result
246268
if: ${{ always() }}
@@ -459,6 +481,13 @@ jobs:
459481
echo "Details:"
460482
cat "examples-status/details.txt"
461483
fi
484+
for file in "examples-status/build-examples.log" "examples-status/install-examples.log"; do
485+
if [[ -f "$file" ]]; then
486+
echo "::group::$(basename "$file")"
487+
cat "$file"
488+
echo "::endgroup::"
489+
fi
490+
done
462491
exit 1
463492
fi
464493

0 commit comments

Comments
 (0)