Skip to content

ci(governance): wire governance.yml + bump CONSTRAINTS to v0.3.0 #2

ci(governance): wire governance.yml + bump CONSTRAINTS to v0.3.0

ci(governance): wire governance.yml + bump CONSTRAINTS to v0.3.0 #2

Workflow file for this run

name: Governance

Check failure on line 1 in .github/workflows/governance.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/governance.yml

Invalid workflow file

(Line: 158, Col: 14): Unexpected symbol: '$job'. Located at position 7 within expression: needs.$job.result
on:
push:
branches: [main]
paths:
- 'website/**'
- 'pkg/**'
- 'internal/**'
- 'cmd/**'
- 'tests/**'
- '.github/workflows/governance.yml'
- 'docs/adr/ADR-0016-direction-a-governance.md'
- 'docs/standards/maintenance.md'
- 'docs/CONSTRAINTS.md'
workflow_dispatch:
permissions:
contents: read
# Soft-fail strategy: a11y/lighthouse/godoc warnings do not block CI.
# Only the perf-budget job is hard-failing (hard budget threshold).
concurrency:
group: governance
cancel-in-progress: true
jobs:
# ---- Hard gate: bundle size budget. Block merge on fail. ----
perf-budget:
name: Perf budget (initial JS <= 200KB gz)
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install deps
run: npm install --no-audit --no-fund
- name: Build (Next export)
run: npm run build
- name: Run perf budget
run: node scripts/perf-budget.mjs
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: perf-budget
path: website/.perf-budget.json
retention-days: 14
# ---- Soft gate: Lighthouse audit (homepage categories). ----
lighthouse:
name: Lighthouse CI (perf/a11y/bp/seo)
runs-on: ubuntu-latest
needs: perf-budget
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install deps
run: npm install --no-audit --no-fund
- name: Build (Next export)
run: npm run build
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v9
with:
configPath: ./.lighthouserc.cjs
uploadArtifacts: true
temporaryPublicStorage: true
# ---- Soft gate: axe-core a11y across 9 locales. ----
a11y:
name: axe-core a11y (9 locales)
runs-on: ubuntu-latest
needs: perf-budget
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install test deps
working-directory: tests
run: npm install --no-audit --no-fund
- name: Install Chromium for Playwright
working-directory: tests
run: npx playwright install --with-deps chromium
- name: Build (Next export)
working-directory: website
run: npm install --no-audit --no-fund && npm run build
- name: Run axe a11y
working-directory: tests
run: npm run test:a11y
- name: Upload a11y logs
if: always()
uses: actions/upload-artifact@v4
with:
name: a11y-logs
path: tests/test-results/
retention-days: 14
# ---- Soft gate: regenerate Go API docs and upload artifact. ----
godocgen:
name: Go public API docs (godocgen)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '1.25'
- name: Generate godoc (en)
run: go run ./cmd/godocgen --locale=en --version=${{ github.sha }}
- name: Smoke test (en content exists)
run: test -f website/content/docs/api/en/pkg-runtime.md
- name: Upload godoc artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: godocgen
path: website/content/docs/api/
retention-days: 14
# ---- Summary job: aggregates results in the GitHub Actions UI. ----
summary:
name: Governance summary
runs-on: ubuntu-latest
needs: [perf-budget, lighthouse, a11y, godocgen]
if: always()
steps:
- name: Summarize
run: |
echo "### Governance results" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
for job in perf-budget lighthouse a11y godocgen; do
result="${{ needs.$job.result }}"
echo "- $job: $result" >> "$GITHUB_STEP_SUMMARY"
done