Files
ollama37/.github/workflows/build.yml
Shang Chieh Tseng 1e99c1bb50 Fix version injection for docker builds
- Add OLLAMA_VERSION build arg to Dockerfiles
- Update Makefile to pass version via --build-arg
- Add .env.example as local development reference
- Update build.yml to use cicd-1 environment for vars.OLLAMA_VERSION

Fixes #8

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 00:42:04 +08:00

99 lines
2.7 KiB
YAML

name: Build Verification
on:
workflow_dispatch: # Manual trigger
inputs:
judge_mode:
description: 'Test judge mode'
required: false
default: 'simple'
type: choice
options:
- 'simple'
- 'llm'
- 'dual'
judge_model:
description: 'LLM model for judging (if llm/dual mode)'
required: false
default: 'gemma3:4b'
type: string
workflow_call: # Called by other workflows
inputs:
judge_mode:
description: 'Test judge mode (simple, llm, dual)'
required: false
default: 'simple'
type: string
judge_model:
description: 'LLM model for judging'
required: false
default: 'gemma3:4b'
type: string
outputs:
result:
description: "Build test result"
value: ${{ jobs.build.outputs.result }}
jobs:
build:
name: Build Verification
runs-on: self-hosted
environment: cicd-1
env:
OLLAMA_VERSION: ${{ vars.OLLAMA_VERSION || '0.0.0' }}
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
# Build judge flags based on input
JUDGE_FLAGS=""
if [ "${{ inputs.judge_mode }}" = "simple" ] || [ -z "${{ inputs.judge_mode }}" ]; then
JUDGE_FLAGS="--no-llm"
elif [ "${{ inputs.judge_mode }}" = "dual" ]; then
JUDGE_FLAGS="--dual-judge --judge-model ${{ inputs.judge_model || 'gemma3:4b' }}"
else
# llm mode
JUDGE_FLAGS="--judge-model ${{ inputs.judge_model || 'gemma3:4b' }}"
fi
echo "Judge mode: ${{ inputs.judge_mode || 'simple' }}"
echo "Judge flags: $JUDGE_FLAGS"
# Progress goes to stderr (visible), JSON results go to file
npm run --silent dev -- run --suite build $JUDGE_FLAGS --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