mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
ci(tests): add optional workflow for generating grammars
run on PR by adding label `ci:generate` or manually
This commit is contained in:
parent
83dae49a10
commit
c5a8c9d01a
6 changed files with 201 additions and 159 deletions
55
.github/workflows/test-core.yml
vendored
Normal file
55
.github/workflows/test-core.yml
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
type:
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
check_compilation:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
nvim_tag: [nightly]
|
||||
name: ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
NVIM: ${{ matrix.os == 'windows-latest' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: tree-sitter/setup-action/cli@v1
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Install and prepare Neovim
|
||||
env:
|
||||
NVIM_TAG: ${{ matrix.nvim_tag }}
|
||||
run: |
|
||||
bash ./scripts/ci-install.sh
|
||||
|
||||
- if: inputs.type == 'generate'
|
||||
name: Generate and compile parsers
|
||||
run: $NVIM -l ./scripts/install-parsers.lua --generate --max-jobs=2
|
||||
|
||||
- if: inputs.type == 'queries'
|
||||
name: Setup Parsers Cache
|
||||
id: parsers-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.local/share/nvim/site/parser/
|
||||
~/AppData/Local/nvim-data/site/parser/
|
||||
key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles(
|
||||
'./lua/nvim-treesitter/install.lua',
|
||||
'./lua/nvim-treesitter/parsers.lua') }}
|
||||
|
||||
- if: inputs.type == 'queries'
|
||||
name: Compile parsers
|
||||
run: $NVIM -l ./scripts/install-parsers.lua
|
||||
|
||||
- name: Check query files
|
||||
run: $NVIM -l ./scripts/check-queries.lua
|
||||
Loading…
Add table
Add a link
Reference in a new issue