From 0d556c749120cdbac5e77704a830835512ac75ae Mon Sep 17 00:00:00 2001 From: Bartek Mucha Date: Sat, 14 Aug 2021 11:42:39 +0100 Subject: [PATCH] Run tests in CI --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ lua/refactoring/tests/minimal.vim | 20 ++++++++++++-------- 2 files changed, 40 insertions(+), 8 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 00000000..24053f36 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: [push, pull_request] + +jobs: + lint: + name: PlenaryBustedDirectory + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + path: refactoring.nvim + - uses: actions/checkout@v2 + with: + repository: nvim-treesitter/nvim-treesitter + path: nvim-treesitter + - uses: actions/checkout@v2 + with: + repository: nvim-lua/plenary.nvim + path: plenary.nvim + - name: Setup + run: | + sudo apt-get update + sudo add-apt-repository ppa:neovim-ppa/unstable + sudo apt-get install neovim + - name: Test + run: + cd refactoring.nvim && make test diff --git a/lua/refactoring/tests/minimal.vim b/lua/refactoring/tests/minimal.vim index 6ec5ad8f..35769db5 100644 --- a/lua/refactoring/tests/minimal.vim +++ b/lua/refactoring/tests/minimal.vim @@ -23,12 +23,16 @@ set shiftwidth=4 runtime! plugin/plenary.vim lua < 0 then + -- fixes 'pos_delta >= 0' error - https://github.com/nvim-lua/plenary.nvim/issues/52 + vim.cmd('set display=lastline') + -- make "TSInstall*" available + vim.cmd 'runtime! plugin/nvim-treesitter.vim' + vim.cmd('TSInstallSync ' .. table.concat(to_install, ' ')) +end EOF