summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2020-12-09 21:48:55 +0100
committerGitHub <noreply@github.com>2020-12-09 15:48:55 -0500
commitd67eb599fba59cf5da5c5a75f799923f08aebeca (patch)
tree5a52f8b43cf42f20d1ecee8f7c194ff87bf87fff
parent141dc6d55e4f53ee9527adc164a0d39725394bfd (diff)
ci: Pipeline Tests (#315)
-rw-r--r--.github/workflows/ci.yml69
-rw-r--r--Makefile2
-rw-r--r--lua/tests/automated/action_spec.lua2
-rw-r--r--lua/tests/automated/resolver_spec.lua2
-rw-r--r--lua/tests/automated/telescope_spec.lua6
5 files changed, 71 insertions, 10 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..28b02af
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,69 @@
+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
+ ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
+ ~/.local/share/nvim/site/pack/vendor/start/popup.nvim
+ key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
+
+ - name: Prepare
+ run: |
+ test -d ~/.local/share/nvim/site/pack/vendor/start || {
+ mkdir -p ~/.local/share/nvim/site/pack/vendor/start
+ git clone https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
+ git clone https://github.com/nvim-lua/popup.nvim ~/.local/share/nvim/site/pack/vendor/start/popup.nvim
+ }
+ ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
+
+ - 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
+ make test
+
+ appimage-ubuntu:
+ name: Appimage-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: |
+ build
+ ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
+ ~/.local/share/nvim/site/pack/vendor/start/popup.nvim
+ key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}
+
+ - name: Prepare
+ run: |
+ test -d build || {
+ mkdir -p build
+ wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
+ chmod +x nvim.appimage
+ mv nvim.appimage ./build/nvim
+ }
+ test -d ~/.local/share/nvim/site/pack/vendor/start || {
+ mkdir -p ~/.local/share/nvim/site/pack/vendor/start
+ git clone https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
+ git clone https://github.com/nvim-lua/popup.nvim ~/.local/share/nvim/site/pack/vendor/start/popup.nvim
+ }
+ ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
+
+ - name: Run tests
+ run: |
+ export PATH="${PWD}/build/:${PATH}"
+ make test
diff --git a/Makefile b/Makefile
index 982d6c6..b30708a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
test:
- nvim --headless -c 'lua require("plenary.test_harness"):test_directory("busted", "./lua/tests/automated/")'
+ nvim --headless -c 'PlenaryBustedDirectory lua/tests/automated/'
lint:
luacheck lua/telescope
diff --git a/lua/tests/automated/action_spec.lua b/lua/tests/automated/action_spec.lua
index e85cb3c..6beacf9 100644
--- a/lua/tests/automated/action_spec.lua
+++ b/lua/tests/automated/action_spec.lua
@@ -1,5 +1,3 @@
-require('plenary.test_harness'):setup_busted()
-
local transform_mod = require('telescope.actions.mt').transform_mod
local eq = function(a, b)
diff --git a/lua/tests/automated/resolver_spec.lua b/lua/tests/automated/resolver_spec.lua
index 9c4822a..b26a9a1 100644
--- a/lua/tests/automated/resolver_spec.lua
+++ b/lua/tests/automated/resolver_spec.lua
@@ -1,5 +1,3 @@
-require('plenary.test_harness'):setup_busted()
-
local eq = function(a, b)
assert.are.same(a, b)
end
diff --git a/lua/tests/automated/telescope_spec.lua b/lua/tests/automated/telescope_spec.lua
index dd437df..bd9203c 100644
--- a/lua/tests/automated/telescope_spec.lua
+++ b/lua/tests/automated/telescope_spec.lua
@@ -1,5 +1,3 @@
-require('plenary.test_harness'):setup_busted()
-
local assert = require('luassert')
local log = require('telescope.log')
@@ -86,7 +84,7 @@ describe('Picker', function()
-- it('should handle no scores', function()
-- local manager = EntryManager:new(5, nil)
- -- manager:add_entry(nil,
+ -- manager:add_entry(nil,
-- end)
it('should allow simple entries', function()
@@ -301,5 +299,3 @@ describe('Sorters', function()
-- assert(PASSED)
-- end)
end)
-
-