Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in CI #54

Merged
merged 1 commit into from
Aug 15, 2021
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
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 @@ -23,12 +23,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