Skip to content

Commit 0fb76c4

Browse files
committed
ci: add corpus test
Problem: PRs are not tested against the variety of queries in the wild. Solution: Include a corpus test using nvim-treesitter's queries.
1 parent 1b1ff02 commit 0fb76c4

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,30 @@ jobs:
4242
id: toolchain
4343
- run: cargo test
4444

45+
corpus:
46+
name: Corpus test
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 10
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: dtolnay/rust-toolchain@1.86.0
52+
id: toolchain
53+
run: cargo build
54+
55+
- name: Clone nvim-treesitter runtime corpus
56+
uses: actions/checkout@v4
57+
with:
58+
repository: nvim-treesitter/nvim-treesitter
59+
ref: main
60+
path: .tests/nvim-treesitter
61+
sparse-checkout: runtime/queries
62+
63+
- name: Check corpus
64+
run: target/debug/ts_query_ls check .tests/nvim-treesitter/runtime/queries
65+
66+
- name: Format corpus
67+
run: target/debug/ts_query_ls format .tests/nvim-treesitter/runtime/queries
68+
4569
generate-schema:
4670
name: Generate schema
4771
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)