From c4040745159fd56a5abe0ba338ac5f1abf64c32d Mon Sep 17 00:00:00 2001 From: windwp Date: Sat, 13 Mar 2021 07:52:51 +0700 Subject: [PATCH] add ci (#6) --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ tests/minimal.vim | 5 +++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b829749 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: Tests + +on: [push, pull_request] + +jobs: + x64-ubuntu: + name: X64-ubuntu + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: date +%F > todays-date + - name: Restore cache for today's nightly. + uses: actions/cache@v2 + with: + path: | + _neovim + key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }} + + - name: Prepare + run: | + mkdir -p ~/.vim/autoload + git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.vim/autoload/plenary.nvim + git clone --depth 1 https://github.com/nvim-lua/popup.nvim ~/.vim/autoload/popup.nvim + git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter ~/.vim/autoload/nvim-treesitter + git clone --depth 1 https://github.com/nvim-treesitter/playground ~/.vim/autoload/playground + ln -s $(pwd) ~/.vim/autoload + - name: Run tests + run: | + curl -OL https://raw.githubusercontent.com/norcalli/bot-ci/master/scripts/github-actions-setup.sh + source github-actions-setup.sh nightly-x64 + nvim --headless -u tests/minimal.vim -c "TSInstallSync all" -c "q" + make test diff --git a/tests/minimal.vim b/tests/minimal.vim index 311a47d..9f5b452 100644 --- a/tests/minimal.vim +++ b/tests/minimal.vim @@ -17,9 +17,14 @@ set nocindent set nosmartindent set indentexpr= +TSUpdate + lua << EOF + local _, ts_utils = pcall(require, 'nvim-treesitter.ts_utils') _G.T=ts_utils require("plenary/busted") require("nvim-ts-autotag").setup() + EOF +