Repository navigation
47 lines (43 loc) · 2.18 KB
/
Copy pathmeta-verify.yml
File metadata and controls
47 lines (43 loc) · 2.18 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
# CI gate — the single required check on `main` (branch protection → context "verify").
#
# It runs the FULL local gate so a bad change (metadata not regenerated, a template
# referencing a dropped payload field, a type break, a broken build, or a failing test)
# fails BEFORE merge:
# • demo:drift = meta verify --templates --codegen --prompts data/templates
# (drift gate; run directly, not via metaobjectsdev/meta-verify-action, which only
# does --templates today — see metaobjects.config.ts per-target `targets`)
# • tsc -b = typecheck the generated + hand-written code
# • build:web = the production Vite build actually compiles
# • test = the full vitest suite (runs without .dev.vars — no secrets needed)
#
# NO `paths:` filter, on purpose: this is a REQUIRED check, and the auto-merge flow
# (.github/workflows/dependabot-auto-merge.yml) waits for it. A paths filter would let a
# lockfile-only Dependabot PR skip the check, leaving the required status "pending"
# forever and the PR un-mergeable — the exact failure that let updates pile up before.
#
# When it fails on a metadata/codegen change: run `npm run gen:db`, commit, re-push.
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read # least-privilege: this job only reads the tree and runs the gate
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 22 # wrangler (postinstall `wrangler types`) needs Node >= 22
cache: npm
- run: npm ci
- run: npm run demo:drift # metadata / prompt / codegen drift gate
- run: npm run verify:db # D1 SCHEMA drift gate — apply migrations to a fresh local
# D1 (miniflare; no Cloudflare auth) then `meta verify --dialect d1`. Catches a
# migration that drifts from the metadata (a missing CHECK, a stale column) the
# way demo:drift catches codegen drift. predeploy adds the --remote counterpart.
- run: npx tsc -b # typecheck generated + hand-written code
- run: npm run build:web # production build compiles
- run: npm test # full vitest suite (no secrets required)