Skip to content

Commit 4a9e0ab

Browse files
ci: Run tests on PR opened
1 parent 6b051cf commit 4a9e0ab

2 files changed

Lines changed: 38 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
neovim-version: [stable, nightly]
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: rhysd/action-setup-vim@v1
17+
with:
18+
neovim: true
19+
version: ${{ matrix.neovim-version }}
20+
21+
- name: Install Python treesitter parser
22+
run: |
23+
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter /tmp/nvim-treesitter
24+
nvim --headless \
25+
--cmd "set runtimepath+=/tmp/nvim-treesitter" \
26+
-c "TSInstallSync python" \
27+
-c "q"
28+
29+
- name: Run tests
30+
run: make test

tests/minimal_init.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
local plenary_dir = "/tmp/plenary.nvim"
2-
local ts_dir = vim.fn.stdpath("data") .. "/lazy/nvim-treesitter"
2+
local ts_dirs = {
3+
vim.fn.stdpath("data") .. "/lazy/nvim-treesitter",
4+
"/tmp/nvim-treesitter",
5+
}
36

47
vim.opt.runtimepath:append(".")
58
vim.opt.runtimepath:append(plenary_dir)
6-
if vim.fn.isdirectory(ts_dir) == 1 then
7-
vim.opt.runtimepath:append(ts_dir)
9+
for _, ts_dir in ipairs(ts_dirs) do
10+
if vim.fn.isdirectory(ts_dir) == 1 then
11+
vim.opt.runtimepath:append(ts_dir)
12+
end
813
end
914

1015
vim.cmd("runtime plugin/plenary.vim")

0 commit comments

Comments
 (0)