-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (84 loc) · 3.97 KB
/
ci.yml
File metadata and controls
95 lines (84 loc) · 3.97 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
name: CI
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# Node 24+ runs the .ts sources directly (native type stripping) — no build, no tsx.
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
# Regenerate every grammar's artifacts FIRST: the uncommitted ones
# (*.cst-types.ts / *.cst-match.ts, gitignored) must exist before Typecheck
# and the gates, which import them. Then fail if any COMMITTED artifact
# drifts from the regenerated output (someone edited a grammar but forgot
# to regenerate). Covers all grammars (sources at the repo root) + the
# tree-sitter packages.
- name: Generate editor artifacts (committed ones must be in sync)
run: |
npm run gen
git diff --exit-code -- '*.tmLanguage.json' '*.language-configuration.json' '*.monarch.json' '*.contributes.json' tree-sitter
- name: Typecheck
run: npx tsc --noEmit
# Every correctness GATE through ONE runner — sanity / agnostic / conformance /
# highlighter / vue / yaml / the generative scope≡role check / the gap-ledger selftest
# + --check (stale KNOWN-GAPS.md fails). One ✓/✗ summary, one exit code. The comparative
# METRICS (scope-gap / src-coverage) and BENCH tools need the external TS corpus / VS Code
# grammars and run in the readme-bench workflow, not here. See TESTING.md for the taxonomy.
- name: Test
run: npm run check
# The derived tree-sitter highlighter is the strongest thesis proof (a real GLR
# parser from the same grammar, beating the official hand-written one). Build its
# wasm and gate the accuracy so the 95.9% is verified, not just claimed. The
# tree-sitter CLI bundles its own wasm toolchain — no emscripten/docker needed.
treesitter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm ci
# Cheap LR-conflict gate: `tree-sitter generate` (no wasm) for every derived
# grammar that is a tree-sitter target, so a conflict introduced by a grammar
# change is caught even for the dialects whose wasm is not built below (tsx/js/jsx)
# — exactly the gap that let an unresolved `type`/`class_heritage` conflict ship.
# yaml is now included (issue #3): its indent/scalar tokens are wired as tree-sitter
# externals and the C indentation scanner is implemented, so its grammar generates + builds.
- name: Generate every derived tree-sitter grammar (conflict gate, no wasm)
run: |
for g in typescript typescriptreact javascript javascriptreact html yaml; do
echo "── tree-sitter generate: $g"
( cd "tree-sitter/$g" && npx tree-sitter generate )
done
- name: Build the derived tree-sitter grammar to wasm
run: |
cd tree-sitter/typescript
npx tree-sitter generate
npx tree-sitter build --wasm .
- name: Tree-sitter accuracy gate (≥ floor, must beat official)
run: node test/treesitter-bench.ts
- name: Build + gate the derived HTML tree-sitter grammar (v1, vs parse5)
run: |
cd tree-sitter/html
npx tree-sitter generate
npx tree-sitter build --wasm .
cd ../..
node test/html-treesitter.ts
# The derived YAML tree-sitter (issue #3) — build the wasm (its C indentation scanner must
# compile + link). The accuracy bench (test/treesitter-yaml-bench.ts) needs the yaml-test-suite
# checkout, so it runs in the readme-bench workflow where the suite is already cloned.
- name: Build the derived YAML tree-sitter grammar to wasm
run: |
cd tree-sitter/yaml
npx tree-sitter generate
npx tree-sitter build --wasm .