Skip to content
Draft
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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests

on: [push, pull_request]

jobs:
unit_tests:
name: unit tests
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
manager: sudo apt-get
#packages: -y fd-find mlocate
- os: ubuntu-20.04
url: https://github.com/neovim/neovim/releases/download/v0.7.0/nvim-linux64.tar.gz
manager: sudo apt-get
#packages: -y fd-find mlocate
steps:
- uses: actions/checkout@v2
- run: date +%F > todays-date
- name: Restore from todays cache
uses: actions/cache@v2
with:
path: _neovim
key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }}

- name: Prepare
run: |
${{ matrix.manager }} update
${{ matrix.manager }} install ${{ matrix.packages }}
test -d _neovim || {
mkdir -p _neovim
curl -sL ${{ matrix.url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
git clone --depth 1 https://github.com/nvim-telescope/telescope.nvim ~/.local/share/nvim/site/pack/vendor/start/telescope.nvim
git clone --depth 1 https://github.com/L3MON4D3/LuaSnip.nvim ~/.local/share/nvim/site/pack/vendor/start/LuaSnip.nvim
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start

- name: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
nvim --version
make test_ci
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.PHONY: lint stylua
.PHONY: test_ci, lint stylua

all: test_ci lint

test_ci:
@nvim --headless -c "PlenaryBustedDirectory lua/tests/ {}"

lint:
luacheck lua/telescope
@luacheck lua/telescope

stylua:
stylua --color always lua/

@stylua --color always lua/

5 changes: 5 additions & 0 deletions lua/tests/automated/telescope_basics_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('sanity check tests: ', function()
it('Telescope builtin', function()
vim.cmd [[Telescope builtin]]
end)
end)
5 changes: 5 additions & 0 deletions lua/tests/automated/telescope_invoke_snippets_previewer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('plugin smoke tests: ', function()
it('Telescope luasnip', function()
vim.cmd [[Telescope luasnip]]
end)
end)
Loading