nvim-treesitter/.github/workflows/test-queries.yml
2023-09-09 16:17:03 +02:00

86 lines
2.2 KiB
YAML

name: Test queries
on:
# push:
# branches:
# - "main"
pull_request:
branches:
- "main"
# Cancel any in-progress CI runs for a PR if it is updated
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
check_compilation:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022, macos-latest]
cc: [gcc, clang]
nvim_tag: [nightly]
exclude:
- os: ubuntu-latest
cc: clang
nvim_tag: nightly
- os: macos-latest
cc: gcc
nvim_tag: nightly
- os: windows-2022
cc: gcc
nvim_tag: nightly
- os: windows-2022
cc: clang
nvim_tag: nightly
# include:
# - os: windows-2022
# cc: cl
# nvim_tag: nightly
# - os: ubuntu-latest
# cc: gcc
# nvim_tag: nightly
name: Parser compilation
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.cc }}
NVIM: ${{ matrix.os == 'windows-2022' && 'nvim-win64\\bin\\nvim.exe' || 'nvim' }}
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-node@v3
- name: Install tree-sitter CLI
run: npm i -g tree-sitter-cli
- name: Install and prepare Neovim
env:
NVIM_TAG: ${{ matrix.nvim_tag }}
run: |
bash ./scripts/ci-install-${{ matrix.os }}.sh
- name: Setup Parsers Cache
id: parsers-cache
uses: actions/cache@v3
with:
path: |
~/.local/share/nvim/site/parser/
~/AppData/Local/nvim-data/site/parser/
key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.nvim_tag }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/util.lua') }}
- name: Compile parsers
run: $NVIM -l ./scripts/install-parsers.lua
- name: Check query files
run: ./scripts/check-queries.lua