mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
99 lines
2.9 KiB
YAML
99 lines
2.9 KiB
YAML
name: Parser compilation and query file check
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches:
|
|
- 'master'
|
|
|
|
# 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
|
|
|
|
jobs:
|
|
check_compilation_unix_like:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-2022, macos-latest]
|
|
cc: [ gcc, clang ]
|
|
nvim_tag: [ stable ]
|
|
exclude:
|
|
- os: ubuntu-latest
|
|
cc: clang
|
|
nvim_tag: stable
|
|
|
|
- os: macos-latest
|
|
cc: gcc
|
|
nvim_tag: stable
|
|
|
|
include:
|
|
- os: windows-2022
|
|
cc: cl
|
|
nvim_tag: stable
|
|
|
|
- os: ubuntu-latest
|
|
cc: gcc
|
|
nvim_tag: nightly
|
|
|
|
name: Parser compilation
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
CC: ${{ matrix.cc }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ilammy/msvc-dev-cmd@v1.5.0
|
|
- uses: actions/setup-node@v2
|
|
|
|
- name: Install and prepare Neovim
|
|
env:
|
|
NVIM_TAG: ${{ matrix.nvim_tag }}
|
|
TREE_SITTER_CLI_TAG: v0.20.2
|
|
run: |
|
|
bash ./scripts/ci-install-${{ matrix.os }}.sh
|
|
|
|
- name: Setup Parsers Cache
|
|
id: parsers-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ./parser/
|
|
key: ${{ matrix.os }}-parsers-v1-${{ hashFiles('./lockfile.json', './lua/nvim-treesitter/parsers.lua', './lua/nvim-treesitter/install.lua', './lua/nvim-treesitter/shell_selectors.lua') }}
|
|
|
|
- name: ccache
|
|
if: matrix.os != 'windows-2022'
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
with:
|
|
key: ${{ matrix.os }}-${{ matrix.cc }}
|
|
|
|
- name: Compile parsers Unix like
|
|
if: matrix.os != 'windows-2022'
|
|
run: |
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
nvim --headless -c "TSInstallSync all" -c "q"
|
|
|
|
- name: Compile parsers Windows
|
|
if: matrix.os == 'windows-2022'
|
|
run: |
|
|
Neovim\\bin\\nvim.exe --headless -c "lua require'nvim-treesitter.install'.prefer_git=false" -c "TSInstallSync all" -c "q"
|
|
|
|
- name: Post compile Windows
|
|
if: matrix.os == 'windows-2022'
|
|
run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser
|
|
shell: bash
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: parsers-${{ matrix.os }}-${{ matrix.cc }}-x86_64
|
|
path: parser/*
|
|
|
|
- name: Check query files (Unix)
|
|
if: matrix.os != 'windows-2022'
|
|
run: nvim --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
|
|
|
- name: Check query files (Windows)
|
|
if: matrix.os == 'windows-2022'
|
|
run: Neovim\\bin\\nvim.exe --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|