aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test-queries.yml
blob: 819924c43b644a3310e1c1ab7e50612c7aa8d3d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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-latest, macos-14]
        nvim_tag: [nightly]

    name: Parser compilation
    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

      - 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') }}

      - name: Compile parsers
        run: $NVIM -l ./scripts/install-parsers.lua

      - name: Check query files
        run: $NVIM -l ./scripts/check-queries.lua