Skip to content

Commit e966c35

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 e966c35

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches: ['master']
55
pull_request:
66
branches: ['master']
7+
workflow_dispatch:
78
permissions:
89
contents: read
910

@@ -42,6 +43,36 @@ jobs:
4243
id: toolchain
4344
- run: cargo test
4445

46+
corpus:
47+
name: Corpus test
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 10
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: dtolnay/rust-toolchain@1.86.0
53+
id: toolchain
54+
- run: |
55+
cargo build
56+
echo ${{ github.workspace }}/target/debug >> $GITHUB_PATH
57+
58+
- name: Clone nvim-treesitter runtime corpus
59+
uses: actions/checkout@v4
60+
with:
61+
repository: nvim-treesitter/nvim-treesitter
62+
ref: main
63+
path: .tests/nvim-treesitter
64+
sparse-checkout: runtime/queries
65+
66+
- name: Check corpus
67+
run: |
68+
cd .tests/nvim-treesitter
69+
ts_query_ls check runtime/queries
70+
71+
- name: Format corpus
72+
run: |
73+
cd .tests/nvim-treesitter
74+
ts_query_ls format runtime/queries
75+
4576
generate-schema:
4677
name: Generate schema
4778
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)