Fix workflows to fail on test failures

The '|| true' was swallowing test runner exit codes, causing workflows
to pass even when tests failed. Added separate 'Check test results'
step that reads JSON summary and fails workflow if any tests failed.

Affected workflows:
- build.yml
- runtime.yml
- inference.yml
- full-pipeline.yml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shang Chieh Tseng
2025-12-15 21:48:40 +08:00
parent f59834c531
commit 0e66cc6f93
4 changed files with 51 additions and 3 deletions

View File

@@ -37,9 +37,12 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/build-results.json cat /tmp/build-results.json
# Check if any tests failed - name: Check test results
if grep -q '"pass": false' /tmp/build-results.json; then run: |
echo "Some build tests failed" FAILED=$(jq '.summary.failed' /tmp/build-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED build test(s) failed"
exit 1 exit 1
fi fi

View File

@@ -67,6 +67,15 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/runtime-results.json cat /tmp/runtime-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/runtime-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED runtime test(s) failed"
exit 1
fi
- name: Upload runtime results - name: Upload runtime results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()
@@ -100,6 +109,15 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/inference-results.json cat /tmp/inference-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/inference-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED inference test(s) failed"
exit 1
fi
- name: Upload inference results - name: Upload inference results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()
@@ -139,6 +157,15 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/llm-judged-results.json cat /tmp/llm-judged-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/llm-judged-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED test(s) failed LLM evaluation"
exit 1
fi
- name: Upload final results - name: Upload final results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()

View File

@@ -63,6 +63,15 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/inference-results.json cat /tmp/inference-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/inference-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED inference test(s) failed"
exit 1
fi
- name: Upload inference results - name: Upload inference results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()

View File

@@ -59,6 +59,15 @@ jobs:
echo "--- JSON Results ---" echo "--- JSON Results ---"
cat /tmp/runtime-results.json cat /tmp/runtime-results.json
- name: Check test results
run: |
FAILED=$(jq '.summary.failed' /tmp/runtime-results.json)
echo "Failed tests: $FAILED"
if [ "$FAILED" -gt 0 ]; then
echo "::error::$FAILED runtime test(s) failed"
exit 1
fi
- name: Upload runtime results - name: Upload runtime results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
if: always() if: always()