Skip to content

Commit 1d4fbf4

Browse files
committed
devops: initial test pipeline
1 parent eff28c8 commit 1d4fbf4

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: rhysd/action-setup-vim@v1
14+
with:
15+
neovim: true
16+
version: stable
17+
18+
- run: make test

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
DEPS_DIR := $(CURDIR)/deps
2+
3+
.PHONY: test deps
4+
5+
# Download mini.nvim if not present, then run all tests
6+
test: deps
7+
nvim --headless -u tests/minimal_init.lua -c "lua MiniTest.run()" 2>&1
8+
9+
# Clone mini.nvim into deps/
10+
deps:
11+
@if [ ! -d "$(DEPS_DIR)/mini.nvim" ]; then \
12+
echo "Downloading mini.nvim..."; \
13+
mkdir -p "$(DEPS_DIR)"; \
14+
git clone --depth 1 https://github.com/echasnovski/mini.nvim "$(DEPS_DIR)/mini.nvim"; \
15+
fi

tests/minimal_init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vim.cmd([[let &rtp.=','.getcwd()]])
2+
vim.cmd("set rtp+=deps/mini.nvim")
3+
4+
require("mini.test").setup()

tests/test_setup.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
local T = MiniTest.new_set()
2+
3+
T["setup() works without errors"] = function()
4+
require("zen").setup({})
5+
MiniTest.expect.equality(vim.o.splitkeep, "screen")
6+
end
7+
8+
return T

0 commit comments

Comments
 (0)