Skip to content

fix(quality): size viewBox-only SVGs and judge them on a checkerboard #1883

fix(quality): size viewBox-only SVGs and judge them on a checkerboard

fix(quality): size viewBox-only SVGs and judge them on a checkerboard #1883

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: '17 10 * * 1'
permissions:
contents: read
concurrency:
group: liminal-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 20
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 20
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@10.30.1 --activate
- name: Verify toolchain
run: |
echo "Node: $(node --version)"
echo "pnpm: $(pnpm --version)"
- run: pnpm install --frozen-lockfile
- name: Security audit
run: pnpm audit --audit-level moderate
- name: Orphan source check
run: pnpm check:orphans
- name: Package script target check
run: pnpm check:script-targets
- name: Liminal shared artifact contract check
run: pnpm check:sinter-contracts
- run: pnpm lint
- run: pnpm build
- name: Sing package build
run: pnpm sing:build
- name: Prompt surface audit
run: npx tsx scripts/ci/check-prompt-surface.ts
- name: Route performance proof
run: pnpm proof:route-performance
- run: pnpm test:ci:fast
- name: Test quality check
run: pnpm test:quality
- name: Check coverage gaps
if: always()
run: |
if [ -f coverage/coverage-final.json ]; then
npx tsx scripts/ci/check-coverage-gaps.ts --warn
else
echo "⚠️ coverage/coverage-final.json not found — skipping coverage gap check (test step may have failed)"
fi
- name: Coverage target progress
if: always()
run: |
if [ -f coverage/coverage-summary.json ]; then
echo "## Coverage Target Progress (70% goal)"
node -e "
const s = require('./coverage/coverage-summary.json');
const t = s.total;
const metrics = [
['Statements', t.lines.pct],
['Branches', t.branches.pct],
['Functions', t.functions.pct],
['Lines', t.lines.pct],
];
const TARGET = 70;
let allMet = true;
console.log('| Metric | Current | Target | Gap | Status |');
console.log('|--------|---------|--------|-----|--------|');
for (const [name, pct] of metrics) {
const gap = (TARGET - pct).toFixed(1);
const status = pct >= TARGET ? 'ON TARGET' : 'BELOW TARGET';
if (pct < TARGET) allMet = false;
console.log('| ' + name + ' | ' + pct + '% | ' + TARGET + '% | ' + gap + 'pp | ' + status + ' |');
}
console.log('');
if (allMet) {
console.log('TARGET MET: All metrics at or above 70%');
} else {
console.log('TARGET NOT MET: Coverage must reach 70%. Priority modules: src/music/, src/plugins/, src/config/, src/generators/');
}
"
fi
- name: Coverage summary
if: always()
run: |
if [ -f coverage/coverage-summary.json ]; then
echo "## Coverage Summary"
node -e "
const s = require('./coverage/coverage-summary.json');
const t = s.total;
console.log('| Metric | Covered | Total | % |');
console.log('|--------|---------|-------|---|');
for (const [k,v] of [['Statements','lines'],['Branches','branches'],['Functions','functions'],['Lines','lines']]) {
console.log('| '+k+' | '+t[v].covered+' | '+t[v].total+' | '+t[v].pct+'% |');
}
"
fi
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7
browser-and-e2e-smoke:
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 20
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 20
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@10.30.1 --activate
- name: Verify toolchain
run: |
echo "Node: $(node --version)"
echo "pnpm: $(pnpm --version)"
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm exec playwright install chromium
- run: pnpm test:e2e
slow-browser-and-e2e:
if: github.event_name != 'pull_request'
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 20
- name: Enable pnpm
run: |
corepack enable
corepack prepare pnpm@10.30.1 --activate
- name: Verify toolchain
run: |
echo "Node: $(node --version)"
echo "pnpm: $(pnpm --version)"
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm exec playwright install chromium
- run: pnpm test:ci:slow