A README change was building a multi-arch Docker image. Both workflows now ignore markdown, docs/, demo/, .gitignore and LICENSE. providers/*.json is deliberately not ignored: CI fails if one stops parsing, which is the one data change that can break a running gateway. arm64 is cross-built under QEMU and dominates the Docker job, so it is now only built for tagged releases; main and PRs build native amd64 only. QEMU setup is skipped entirely when it is not needed. Anchors would have kept the paths-ignore lists DRY, but Actions has been unreliable with them and a broken workflow costs more than five duplicated lines. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
# Prose cannot break a build. Provider JSON can, so it is NOT ignored —
|
|
# the last step here fails if any providers/*.json stops parsing.
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- 'docs/**'
|
|
- 'demo/**'
|
|
- '.gitignore'
|
|
- 'LICENSE'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
- 'docs/**'
|
|
- 'demo/**'
|
|
- '.gitignore'
|
|
- 'LICENSE'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-test:
|
|
name: build & test (node ${{ matrix.node }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# 22 is the floor the package declares; 24 catches breakage early.
|
|
node: ['22', '24']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: npm
|
|
|
|
- run: npm ci --no-audit --no-fund
|
|
|
|
- name: Typecheck and build
|
|
run: npm run build
|
|
|
|
- name: Test
|
|
run: node --test packages/*/test/*.test.ts
|
|
|
|
- name: Verify every shipped provider file parses
|
|
run: |
|
|
node --input-type=module -e "
|
|
import { Registry } from './packages/core/dist/registry.js';
|
|
const reg = new Registry({ dir: 'providers', env: {} });
|
|
const errors = reg.issues().filter(i => i.level === 'error');
|
|
for (const i of reg.issues()) console.log(\`[\${i.level}] \${i.file}: \${i.message}\`);
|
|
if (errors.length) { console.error(\`\${errors.length} provider file(s) failed to parse\`); process.exit(1); }
|
|
console.log(\`ok — \${reg.all().length} providers loaded\`);
|
|
"
|