mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-20 20:57:01 +00:00
Split monolithic workflow into modular components
Separate workflows for flexibility: - build.yml: Build verification (standalone + reusable) - runtime.yml: Container & runtime tests with container lifecycle - inference.yml: Inference tests with optional container management - full-pipeline.yml: Orchestrates all stages with LLM judge Each workflow can be triggered independently for targeted testing, or run the full pipeline for complete validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
78
.github/workflows/inference.yml
vendored
Normal file
78
.github/workflows/inference.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Inference Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger
|
||||
inputs:
|
||||
use_existing_container:
|
||||
description: 'Use existing running container'
|
||||
required: false
|
||||
default: 'false'
|
||||
type: choice
|
||||
options:
|
||||
- 'true'
|
||||
- 'false'
|
||||
workflow_call: # Called by other workflows
|
||||
inputs:
|
||||
use_existing_container:
|
||||
description: 'Container is already running'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
outputs:
|
||||
result:
|
||||
description: "Inference test result"
|
||||
value: ${{ jobs.inference.outputs.result }}
|
||||
|
||||
env:
|
||||
OLLAMA_HOST: http://localhost:11434
|
||||
|
||||
jobs:
|
||||
inference:
|
||||
name: Inference Tests
|
||||
runs-on: self-hosted
|
||||
outputs:
|
||||
result: ${{ steps.inference-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: Start container (if needed)
|
||||
if: ${{ inputs.use_existing_container != 'true' && inputs.use_existing_container != true }}
|
||||
run: |
|
||||
cd docker
|
||||
docker compose down 2>/dev/null || true
|
||||
docker compose up -d
|
||||
sleep 10
|
||||
|
||||
- name: Run inference tests
|
||||
id: inference-tests
|
||||
run: |
|
||||
cd tests
|
||||
# Progress goes to stderr (visible), JSON results go to file
|
||||
npm run --silent dev -- run --suite inference --no-llm --output json > /tmp/inference-results.json || true
|
||||
|
||||
echo "--- JSON Results ---"
|
||||
cat /tmp/inference-results.json
|
||||
|
||||
- name: Upload inference results
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: inference-test-results
|
||||
path: /tmp/inference-results.json
|
||||
|
||||
- name: Stop container (if we started it)
|
||||
if: ${{ always() && inputs.use_existing_container != 'true' && inputs.use_existing_container != true }}
|
||||
run: |
|
||||
cd docker
|
||||
docker compose down || true
|
||||
echo "Container stopped"
|
||||
Reference in New Issue
Block a user