Files
ollama37/.github/workflows/build.yml
Shang Chieh Tseng 0e66cc6f93 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>
2025-12-15 21:48:40 +08:00

55 lines
1.4 KiB
YAML

name: Build Verification
on:
workflow_dispatch: # Manual trigger
workflow_call: # Called by other workflows
outputs:
result:
description: "Build test result"
value: ${{ jobs.build.outputs.result }}
jobs:
build:
name: Build Verification
runs-on: self-hosted
outputs:
result: ${{ steps.build-tests.outcome }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install test runner dependencies
run: cd tests && npm ci
- name: Run build tests
id: build-tests
run: |
cd tests
# Progress goes to stderr (visible), JSON results go to file
npm run --silent dev -- run --suite build --no-llm --output json > /tmp/build-results.json || true
echo "--- JSON Results ---"
cat /tmp/build-results.json
- name: Check test results
run: |
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
fi
- name: Upload build results
uses: actions/upload-artifact@v4
if: always()
with:
name: build-test-results
path: /tmp/build-results.json