Merge pull request #461 from nvim-treesitter/cits

ci: install treesitter
This commit is contained in:
Lewis Russell 2024-07-02 17:58:51 +01:00 committed by GitHub
commit e23218b816
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 41 additions and 17 deletions

View file

@ -20,11 +20,12 @@ jobs:
strategy:
fail-fast: false
matrix:
neovim_version: ['v0.9.5']
neovim_version:
- 'v0.9.5'
# - 'v0.10.0'
env:
NEOVIM_VERSION: ${{ matrix.neovim_version }}
IS_CI: 1
steps:
- name: Checkout
@ -36,11 +37,25 @@ jobs:
- uses: leafo/gh-actions-luarocks@v4
- uses: tree-sitter/setup-action/cli@v1
- name: Download nvim-test
run: make nvim-test
- name: Download nvim-treesitter
run: make nvim-treesitter
- name: Parsers Cache
uses: actions/cache@v4
with:
path: ./nvim-treesitter/parser/
key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles(
'./nvim-treesitter/lockfile.json',
'./nvim-treesitter/lua/nvim-treesitter/install.lua',
'./nvim-treesitter/lua/nvim-treesitter/parsers.lua') }}
- name: Install parsers
run: make parsers NEOVIM_VERSION=$NEOVIM_VERSION
run: make parsers
- name: Run Test
run: make test NEOVIM_VERSION=$NEOVIM_VERSION
run: make test

View file

@ -16,7 +16,6 @@ jobs:
env:
NVIM_TS_SHA: master
IS_CI: 1
steps:
- name: Checkout
@ -28,14 +27,28 @@ jobs:
- uses: leafo/gh-actions-luarocks@v4
- uses: tree-sitter/setup-action/cli@v1
- name: Download nvim-test
run: make nvim-test
- name: Download nvim-treesitter
run: make nvim-treesitter
- name: Parsers Cache
uses: actions/cache@v4
with:
path: ./nvim-treesitter/parser/
key: parsers-${{ join(matrix.*, '-') }}-${{ hashFiles(
'./nvim-treesitter/lockfile.json',
'./nvim-treesitter/lua/nvim-treesitter/install.lua',
'./nvim-treesitter/lua/nvim-treesitter/parsers.lua') }}
- name: Install parsers
run: make parsers
- name: Run Test
run: make test NVIM_TS_SHA=$NVIM_TS_SHA
run: make test
- uses: stefanzweifel/git-auto-commit-action@v5
with:

View file

@ -1,8 +1,9 @@
.DEFAULT_GOAL := test
NEOVIM_VERSION := v0.9.5
NEOVIM_VERSION ?= v0.9.5
NEOVIM_RUNNER_VERSION ?= v0.10.0
NVIM_TS_SHA := 98460428
NVIM_TS_SHA ?= 98460428
FILTER=.*
@ -16,14 +17,14 @@ nvim-treesitter:
nvim-test:
git clone https://github.com/lewis6991/nvim-test
nvim-test/bin/nvim-test --init
--runner_version $(NEOVIM_VERSION) \
nvim-test/bin/nvim-test --init \
--runner_version $(NEOVIM_RUNNER_VERSION) \
--target_version $(NEOVIM_VERSION)
.PHONY: test
test: nvim-test nvim-treesitter
nvim-test/bin/nvim-test test \
--runner_version $(NEOVIM_VERSION) \
--runner_version $(NEOVIM_RUNNER_VERSION) \
--target_version $(NEOVIM_VERSION) \
--lpath=$(PWD)/lua/?.lua \
--filter="$(FILTER)" \
@ -31,7 +32,7 @@ test: nvim-test nvim-treesitter
.PHONY: parsers
parsers: nvim-test nvim-treesitter
$(XDG_DATA_HOME)/nvim-test/nvim-test-$(NEOVIM_VERSION)/bin/nvim \
$(XDG_DATA_HOME)/nvim-test/nvim-runner-$(NEOVIM_RUNNER_VERSION)/bin/nvim \
--clean -u NONE -c 'source install_parsers.lua'
lint:

View file

@ -7,11 +7,6 @@ local cmd = helpers.api.nvim_command
local feed = helpers.feed
local function install_langs(langs)
-- Shouldn't need to do this, but CI seems to hang on some languages
if os.getenv('IS_CI') then
return
end
if type(langs) == 'string' then
langs = {langs}
end