Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
neovim-version: [stable, nightly]
steps:
- uses: actions/checkout@v4

- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim-version }}

- name: Compile Python treesitter parser
run: |
git clone --depth 1 https://github.com/tree-sitter/tree-sitter-python /tmp/tree-sitter-python
mkdir -p parser
cc -shared -fPIC -o parser/python.so -I /tmp/tree-sitter-python/src \
/tmp/tree-sitter-python/src/parser.c /tmp/tree-sitter-python/src/scanner.c

- name: Run tests
run: make test
11 changes: 8 additions & 3 deletions tests/minimal_init.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
local plenary_dir = "/tmp/plenary.nvim"
local ts_dir = vim.fn.stdpath("data") .. "/lazy/nvim-treesitter"
local ts_dirs = {
vim.fn.stdpath("data") .. "/lazy/nvim-treesitter",
"/tmp/nvim-treesitter",
}

vim.opt.runtimepath:append(".")
vim.opt.runtimepath:append(plenary_dir)
if vim.fn.isdirectory(ts_dir) == 1 then
vim.opt.runtimepath:append(ts_dir)
for _, ts_dir in ipairs(ts_dirs) do
if vim.fn.isdirectory(ts_dir) == 1 then
vim.opt.runtimepath:append(ts_dir)
end
end

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