From 4a9e0abc5cf378a77b5c302e5f113d19a3013dbe Mon Sep 17 00:00:00 2001 From: Ruben Garcia Date: Tue, 17 Feb 2026 19:22:09 +0100 Subject: [PATCH 1/2] ci: Run tests on PR opened --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ tests/minimal_init.lua | 11 ++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..01f184a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +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: Install Python treesitter parser + run: | + git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter /tmp/nvim-treesitter + nvim --headless \ + --cmd "set runtimepath+=/tmp/nvim-treesitter" \ + -c "TSInstallSync python" \ + -c "q" + + - 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") From 685939c06fca31ebf9e273e1524f011da78e3bc4 Mon Sep 17 00:00:00 2001 From: Ruben Garcia Date: Tue, 17 Feb 2026 19:26:02 +0100 Subject: [PATCH 2/2] ci: Clone and compile treesitter --- .github/workflows/test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01f184a..1daabf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,13 +18,12 @@ jobs: neovim: true version: ${{ matrix.neovim-version }} - - name: Install Python treesitter parser + - name: Compile Python treesitter parser run: | - git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter /tmp/nvim-treesitter - nvim --headless \ - --cmd "set runtimepath+=/tmp/nvim-treesitter" \ - -c "TSInstallSync python" \ - -c "q" + 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