mirror of https://github.com/folke/lazy.nvim.git
ci: run tests on linux only for nw
This commit is contained in:
parent
75a36f3c94
commit
cb87aa3893
|
@ -5,17 +5,27 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
# os: [ubuntu-latest, windows-latest]
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install Neovim
|
- name: Install Neovim
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||||
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.deb -O /tmp/nvim.deb
|
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.deb -O /tmp/nvim.deb
|
||||||
sudo dpkg -i /tmp/nvim.deb
|
sudo dpkg -i /tmp/nvim.deb
|
||||||
|
else
|
||||||
|
choco install neovim --pre
|
||||||
|
echo "C:/tools/neovim/nvim-win64/bin" >> $GITHUB_PATH
|
||||||
|
fi
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
nvim --version
|
nvim --version
|
||||||
./tests/run
|
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests// {minimal_init = 'tests//init.lua', sequential = true}"
|
||||||
docs:
|
docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: tests
|
needs: tests
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
describe("lazy", function()
|
||||||
|
before_each(function()
|
||||||
|
vim.g.lazy_did_setup = false
|
||||||
|
vim.go.loadplugins = true
|
||||||
|
for modname in pairs(package.loaded) do
|
||||||
|
if modname:find("lazy") == 1 then
|
||||||
|
package.loaded[modname] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
local root = ".tests/data/nvim/lazy"
|
||||||
|
|
||||||
|
it("installs plugins", function()
|
||||||
|
local Lazy = require("lazy")
|
||||||
|
local Config = require("lazy.core.config")
|
||||||
|
|
||||||
|
local neodev = false
|
||||||
|
Lazy.setup({
|
||||||
|
{
|
||||||
|
"folke/neodev.nvim",
|
||||||
|
config = function()
|
||||||
|
neodev = true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"folke/paint.nvim",
|
||||||
|
}, { install_missing = true, defaults = { lazy = true } })
|
||||||
|
assert(3 == vim.tbl_count(Config.plugins))
|
||||||
|
assert(vim.loop.fs_stat(root .. "/paint.nvim/README.md"))
|
||||||
|
assert(vim.loop.fs_stat(root .. "/neodev.nvim/README.md"))
|
||||||
|
assert(not neodev)
|
||||||
|
assert(Config.plugins["neodev.nvim"]._.installed)
|
||||||
|
assert(not Config.plugins["neodev.nvim"]._.is_local)
|
||||||
|
end)
|
||||||
|
end)
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}"
|
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests {minimal_init = 'tests//init.lua', sequential = true}"
|
||||||
|
|
Loading…
Reference in New Issue