ci: add corpus test #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: ['master'] | |
| pull_request: | |
| branches: ['master'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.86.0 | |
| id: toolchain | |
| with: | |
| components: clippy | |
| - run: cargo clippy --tests --no-deps -- -D warnings | |
| format: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.86.0 | |
| id: toolchain | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.86.0 | |
| id: toolchain | |
| - run: cargo test | |
| corpus: | |
| name: Corpus test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.86.0 | |
| id: toolchain | |
| - run: | | |
| cargo build | |
| echo ${{ github.workspace }}/target/debug >> $GITHUB_PATH | |
| - name: Clone nvim-treesitter runtime corpus | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: nvim-treesitter/nvim-treesitter | |
| ref: main | |
| path: .tests/nvim-treesitter | |
| sparse-checkout: runtime/queries | |
| - name: Check corpus | |
| run: | | |
| cd .tests/nvim-treesitter | |
| ts_query_ls check runtime/queries | |
| - name: Format corpus | |
| run: | | |
| cd .tests/nvim-treesitter | |
| ts_query_ls format runtime/queries | |
| generate-schema: | |
| name: Generate schema | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@1.86.0 | |
| id: toolchain | |
| - name: Check schema generation | |
| run: | | |
| # Generate schema | |
| cargo xtask schema | |
| # Check for uncommitted changes | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo '❌ Uncommitted changes detected after running `cargo xtask schema`:' | |
| git --no-pager diff | |
| exit 1 | |
| else | |
| echo "✅ No changes; schema is up to date." | |
| fi |