Repository navigation
106 lines (93 loc) · 4.14 KB
/
Copy pathci.yml
File metadata and controls
106 lines (93 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test + build + drift gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Build
run: pnpm build
# Drift gate: regenerate both sync outputs (create-helpbase templates
# and the shadcn registry source tree) from apps/web and fail if
# either is out of sync. Safeguard against the bug class that shipped
# on 2026-04-09 (scaffolder producing a stub instead of the real help
# center because someone touched apps/web without re-syncing).
- name: Verify sync outputs are in sync with apps/web
run: |
pnpm sync:templates
if ! git diff --exit-code packages/create-helpbase/templates/ registry/helpbase/; then
echo ""
echo "✖ Sync outputs are out of sync with apps/web/"
echo ""
echo " Cause: apps/web was modified without re-running the sync script."
echo " Fix: from the repo root, run:"
echo " pnpm sync:templates"
echo " then commit the result and push again."
echo ""
exit 1
fi
echo "✓ Both sync outputs match apps/web"
# Verify the public/r/*.json registry output is also in sync. This
# catches the case where someone edits registry.json or registry/
# sources without running registry:build.
- name: Verify shadcn registry JSON is in sync
run: |
npx shadcn@latest build
if ! git diff --exit-code public/r/; then
echo ""
echo "✖ public/r/*.json is out of sync with registry.json / registry/helpbase/"
echo ""
echo " Fix: run 'pnpm registry:build' and commit the result."
echo ""
exit 1
fi
echo "✓ public/r/*.json is in sync"
# Supabase types drift gate: table-level check that apps/web/types/supabase.ts
# still declares the tenants / tenant_articles / tenant_categories /
# tenant_chunks / tenant_deploys / tenant_mcp_queries tables plus the
# deploy_tenant RPC signature. Catches the "added a migration, forgot to
# regen types" drift class. Column-level check against a live DB is v1.5.
- name: Verify Supabase types are in sync with schema
run: pnpm check:supabase-types
# Install-path smoke test: scaffolds a fresh project via
# create-helpbase, installs deps, runs the production build, asserts
# expected routes generated. Would have caught the 2026-04-09 dogfood
# gap. Cost: $0. Runtime: ~30-60s.
- name: Install-path smoke test (create-helpbase)
run: pnpm smoke:install
# Registry smoke test: creates a fresh Next.js + shadcn project, runs
# `shadcn add` against our built registry JSON, asserts the build
# produces the expected routes and the MDX articles render. This is
# the test that proves the "drop into an existing project" promise
# in the README is actually honored. Cost: $0. Runtime: ~60-120s.
- name: Registry smoke test (shadcn add)
run: pnpm smoke:registry
# Hosted-tier deploy smoke test: end-to-end CLI → RPC → (optional)
# hosted URL + MCP handshake. Skipped gracefully when the required
# secrets are not available (local dev, forked PRs). When secrets
# are present, this is the ship-gate for hosted tier v1 — if it
# fails, the Vegard install path is broken.
- name: Hosted-tier deploy smoke test
env:
HELPBASE_TOKEN: ${{ secrets.HELPBASE_SMOKE_TOKEN }}
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.SMOKE_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.SMOKE_SUPABASE_ANON_KEY }}
run: pnpm smoke:deploy