mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 14:14:03 +02:00
Merge pull request #461 from nvim-treesitter/cits
ci: install treesitter
This commit is contained in:
commit
e23218b816
4 changed files with 41 additions and 17 deletions
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
|
@ -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
|
||||
|
|
17
.github/workflows/nightly.yml
vendored
17
.github/workflows/nightly.yml
vendored
|
@ -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:
|
||||
|
|
13
Makefile
13
Makefile
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue