From e1e7b3afc4f6adc77bbd8d471eb227a94568c9f1 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Wed, 29 Sep 2021 22:00:45 -0400 Subject: [PATCH] Split neovim tests for ts --- .github/workflows/neovim.yml | 10 +---- .github/workflows/neovim_treesitter.yml | 51 +++++++++++++++++++++++++ test/new/common/bootstrap.vim | 2 +- test/new/test-treesitter/test.vim | 2 +- test/vader/minvimrc | 2 +- 5 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/neovim_treesitter.yml diff --git a/.github/workflows/neovim.yml b/.github/workflows/neovim.yml index f28be7a..d068511 100644 --- a/.github/workflows/neovim.yml +++ b/.github/workflows/neovim.yml @@ -14,6 +14,7 @@ jobs: matrix: neovim_version: - 'head' + - 'v0.5.0' - 'v0.4.3' runs-on: ubuntu-latest steps: @@ -28,12 +29,6 @@ jobs: vim_version: '${{ matrix.neovim_version }}' vim_type: 'Neovim' - - name: Install nvim-treesitter - run: git clone --depth=1 https://github.com/nvim-treesitter/nvim-treesitter.git test/vader/plugged/nvim-treesitter - - - name: Install python treesitter module - run: nvim --headless -Nu test/vader/minvimrc -c 'TSInstallSync python' -c 'q' - - name: 'Show version' run: nvim --version @@ -41,9 +36,6 @@ jobs: run: | bash -c 'VIMCMD=nvim test/vader/run' - - name: Install ruby treesitter module - run: nvim --headless -Nu test/vader/minvimrc -c 'TSInstallSync ruby' -c 'q' - - name: 'Run new tests' run: | cd ./test/new && make -j1 && make -j1 coverage diff --git a/.github/workflows/neovim_treesitter.yml b/.github/workflows/neovim_treesitter.yml new file mode 100644 index 0000000..67916fa --- /dev/null +++ b/.github/workflows/neovim_treesitter.yml @@ -0,0 +1,51 @@ +name: Neovim with Tree-sitter + +on: + push: + branches: + - '*' + pull_request: + branches: + - master + +jobs: + build: + strategy: + matrix: + neovim_version: + - 'head' + - 'v0.5.0' + runs-on: ubuntu-latest + env: + TESTS_ENABLE_TREESITTER: 1 + steps: + - uses: 'actions/checkout@v2' + + - name: Install vader.vim + run: git clone --depth=1 https://github.com/junegunn/vader.vim.git test/vader/vader.vim + + - name: 'setup Neovim' + uses: 'thinca/action-setup-vim@v1' + with: + vim_version: '${{ matrix.neovim_version }}' + vim_type: 'Neovim' + + - name: Install nvim-treesitter + run: git clone --depth=1 https://github.com/nvim-treesitter/nvim-treesitter.git test/vader/plugged/nvim-treesitter + + - name: Install python treesitter module + run: nvim --headless -Nu test/vader/minvimrc -c 'TSInstallSync python' -c 'q' + + - name: 'Show version' + run: nvim --version + + - name: 'Run test' + run: | + bash -c 'VIMCMD=nvim test/vader/run' + + - name: Install ruby treesitter module + run: nvim --headless -Nu test/vader/minvimrc -c 'TSInstallSync ruby' -c 'q' + + - name: 'Run new tests' + run: | + cd ./test/new && make -j1 && make -j1 coverage diff --git a/test/new/common/bootstrap.vim b/test/new/common/bootstrap.vim index ea68611..0a51cad 100644 --- a/test/new/common/bootstrap.vim +++ b/test/new/common/bootstrap.vim @@ -6,7 +6,7 @@ let &rtp = &rtp . ',../../../after' profile start /tmp/vim-profile.txt profile! file */matchup/*.vim -if has('nvim-0.5.0') +if $TESTS_ENABLE_TREESITTER let s:path = simplify(expand(':h').'/../../..') let &rtp = s:path.'/test/vader/plugged/nvim-treesitter,' . &rtp let &rtp .= ','.s:path.'/test/vader/plugged/nvim-treesitter/after' diff --git a/test/new/test-treesitter/test.vim b/test/new/test-treesitter/test.vim index 28e91f8..7afe5f4 100644 --- a/test/new/test-treesitter/test.vim +++ b/test/new/test-treesitter/test.vim @@ -1,7 +1,7 @@ set nocompatible source ../common/bootstrap.vim -if !has('nvim-0.5.0') +if !$TESTS_ENABLE_TREESITTER call matchup#test#finished() endif diff --git a/test/vader/minvimrc b/test/vader/minvimrc index aa19ab5..0df4dae 100644 --- a/test/vader/minvimrc +++ b/test/vader/minvimrc @@ -12,7 +12,7 @@ let &rtp = s:path.'/test/rtp,' . &rtp " load other plugins, if necessary " let &rtp = '~/path/to/other/plugin,' . &rtp -if has('nvim-0.5.0') +if $TESTS_ENABLE_TREESITTER let &rtp = s:path.'/test/vader/plugged/nvim-treesitter,' . &rtp let &rtp .= ','.s:path.'/test/vader/plugged/nvim-treesitter/after'