Skip to content

Commit

Permalink
Merge pull request #54 from muchzill4/ci-tests
Browse files Browse the repository at this point in the history
Run tests in CI
  • Loading branch information
ThePrimeagen authored Aug 15, 2021
2 parents 53ab2b6 + 0d556c7 commit e55f2bf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 12 additions & 8 deletions lua/refactoring/tests/minimal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ set shiftwidth=4
runtime! plugin/plenary.vim

lua <<EOF
require'nvim-treesitter.configs'.setup{
ensure_installed = {
'go',
'lua',
'python',
'typescript',
},
}
local required_parsers = {'go', 'lua', 'python', 'typescript'}
local installed_parsers = require'nvim-treesitter.info'.installed_parsers()
local to_install = vim.tbl_filter(function(parser)
return not vim.tbl_contains(installed_parsers, parser)
end, required_parsers)
if #to_install > 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

0 comments on commit e55f2bf

Please sign in to comment.