diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1daabf0 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/tests/minimal_init.lua b/tests/minimal_init.lua index cdd4b58..0380aa8 100644 --- a/tests/minimal_init.lua +++ b/tests/minimal_init.lua @@ -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")