CI: Print test logs directly on failure instead of uploading artifacts

This commit is contained in:
forbes
2026-01-27 15:31:36 -06:00
parent 09a81e9b0e
commit c173b764e3

View File

@@ -68,29 +68,21 @@ jobs:
- name: Run C++ unit tests
shell: bash
continue-on-error: true
id: ctest
run: |
cd build/release
ctest --output-on-failure --timeout 120 --verbose > ctest_output.log 2>&1
echo "exitcode=$?" >> $GITHUB_OUTPUT
- name: Upload test logs
if: always()
uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: test-logs
path: |
build/release/ctest_output.log
build/release/Testing/Temporary/*.log
if-no-files-found: ignore
- name: Check test results
if: steps.ctest.outputs.exitcode != '0'
run: |
echo "Tests failed with exit code ${{ steps.ctest.outputs.exitcode }}"
echo "Download test-logs artifact for details"
exit 1
ctest --output-on-failure --timeout 120 --verbose 2>&1 && exit 0
EXITCODE=$?
echo ""
echo "=========================================="
echo "TESTS FAILED - Exit code: $EXITCODE"
echo "=========================================="
echo ""
echo "=== ctest output (last 200 lines) ==="
tail -200 Testing/Temporary/LastTest.log 2>/dev/null || echo "No LastTest.log found"
echo ""
echo "=== Failed tests ==="
cat Testing/Temporary/LastTestsFailed.log 2>/dev/null || echo "No LastTestsFailed.log found"
exit $EXITCODE
- name: Install
run: pixi run install-release