Skip to content

Commit a2c3e61

Browse files
committed
tree-sitter-rx: CI for the generated parser, the corpus and the repo's .rx files
1 parent 28a0cbc commit a2c3e61

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

‎.github/workflows/tree-sitter.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# The tree-sitter grammar (tooling/tree-sitter-rx): src/ is generated but committed, since Zed compiles src/parser.c
2+
# as it is, so check it is what grammar.js generates; then the corpus, and every tracked .rx file with no ERROR or
3+
# MISSING node.
4+
name: tree-sitter
5+
6+
on:
7+
push:
8+
branches: [main]
9+
paths: ["tooling/tree-sitter-rx/**", "**/*.rx", ".github/workflows/tree-sitter.yml"]
10+
pull_request:
11+
paths: ["tooling/tree-sitter-rx/**", "**/*.rx", ".github/workflows/tree-sitter.yml"]
12+
workflow_dispatch:
13+
14+
jobs:
15+
grammar:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: tooling/tree-sitter-rx
20+
steps:
21+
- uses: actions/checkout@v5
22+
- uses: pnpm/action-setup@v4
23+
with:
24+
version: 11.1.1 # as editor.yml
25+
- uses: actions/setup-node@v5
26+
with:
27+
node-version: 22
28+
- run: pnpm install --frozen-lockfile
29+
- name: src/ is what grammar.js generates
30+
run: |
31+
pnpm run generate
32+
git diff --exit-code -- src/
33+
- name: Corpus
34+
run: pnpm test
35+
- name: Every tracked .rx file
36+
run: pnpm run parse:repo
37+
- name: Queries
38+
run: pnpm run query -- ../../examples/*.rx > /dev/null

0 commit comments

Comments
 (0)