Use nix for testing environment
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m22s
All checks were successful
NeoVim tests / code-quality (push) Successful in 1m22s
This commit is contained in:
parent
35b6e123ac
commit
d42c55cfea
13
.busted
Normal file
13
.busted
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
_all = {
|
||||||
|
coverage = false,
|
||||||
|
lpath = "lua/?.lua;lua/?/init.lua",
|
||||||
|
lua = "nlua",
|
||||||
|
},
|
||||||
|
default = {
|
||||||
|
verbose = true
|
||||||
|
},
|
||||||
|
tests = {
|
||||||
|
verbose = true
|
||||||
|
},
|
||||||
|
}
|
25
.github/workflows/ci.yaml
vendored
25
.github/workflows/ci.yaml
vendored
@ -2,15 +2,28 @@
|
|||||||
name: NeoVim tests
|
name: NeoVim tests
|
||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
plenary-tests:
|
code-quality:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
XDG_CONFIG_HOME: ${{ github.workspace }}/.config/
|
XDG_CONFIG_HOME: ${{ github.workspace }}/.config/
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: rhysd/action-setup-vim@v1
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
neovim: true
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
version: v0.11.0
|
|
||||||
arch: 'x86_64'
|
- name: Populate Nix store
|
||||||
- run: make test
|
run:
|
||||||
|
nix-shell --run 'true'
|
||||||
|
|
||||||
|
- name: Type-check with lua-language-server
|
||||||
|
run:
|
||||||
|
nix-shell --run 'make lint'
|
||||||
|
|
||||||
|
- name: Check formatting with stylua
|
||||||
|
run:
|
||||||
|
nix-shell --run 'make fmt-check'
|
||||||
|
|
||||||
|
- name: Run busted tests
|
||||||
|
run:
|
||||||
|
nix-shell --run 'make test'
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,4 +1,2 @@
|
|||||||
/.lux/
|
|
||||||
lux.lock
|
|
||||||
*.src.rock
|
*.src.rock
|
||||||
*.aider*
|
*.aider*
|
||||||
|
16
Makefile
16
Makefile
@ -1,16 +1,14 @@
|
|||||||
PLENARY_DIR=~/.local/share/nvim/site/pack/test/opt/plenary.nvim
|
all: lint fmt-check test
|
||||||
|
|
||||||
all: lint test
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
lua-language-server --check=lua/u/ --checklevel=Error
|
lua-language-server --check=lua/u/ --checklevel=Error
|
||||||
lx check
|
@# lx check
|
||||||
|
|
||||||
|
fmt-check:
|
||||||
|
stylua --check .
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
stylua .
|
stylua .
|
||||||
|
|
||||||
test: $(PLENARY_DIR)
|
test:
|
||||||
NVIM_APPNAME=noplugstest nvim -u NORC --headless -c 'set packpath+=~/.local/share/nvim/site' -c 'packadd plenary.nvim' -c "PlenaryBustedDirectory spec/"
|
busted
|
||||||
|
|
||||||
$(PLENARY_DIR):
|
|
||||||
git clone https://github.com/nvim-lua/plenary.nvim/ $(PLENARY_DIR)
|
|
||||||
|
19
lux.toml
19
lux.toml
@ -1,19 +0,0 @@
|
|||||||
package = "u.nvim"
|
|
||||||
version = "0.2.0"
|
|
||||||
lua = ">=5.1"
|
|
||||||
|
|
||||||
[description]
|
|
||||||
summary = ""
|
|
||||||
maintainer = "jrop"
|
|
||||||
labels = [ "library", "neovim", "neovim-plugin", "range", "utility" ]
|
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
# Add your dependencies here
|
|
||||||
# `busted = ">=2.0"`
|
|
||||||
|
|
||||||
[run]
|
|
||||||
args = [ "src/main.lua" ]
|
|
||||||
|
|
||||||
[build]
|
|
||||||
type = "builtin"
|
|
@ -1,4 +0,0 @@
|
|||||||
std = "vim"
|
|
||||||
|
|
||||||
[lints]
|
|
||||||
multiple_statements = "allow"
|
|
19
shell.nix
Normal file
19
shell.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
pkgs ?
|
||||||
|
import
|
||||||
|
# neovim@0.11.1: https://history.nix-packages.com/package/neovim/0.11.1
|
||||||
|
(fetchTarball "https://github.com/nixos/nixpkgs/tarball/e73c3bf29132da092f9c819b97b6e214367eb71f")
|
||||||
|
{ },
|
||||||
|
}:
|
||||||
|
pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
pkgs.git
|
||||||
|
pkgs.gnumake
|
||||||
|
pkgs.lua-language-server
|
||||||
|
pkgs.lua51Packages.busted
|
||||||
|
pkgs.lua51Packages.luarocks
|
||||||
|
pkgs.lua51Packages.nlua
|
||||||
|
pkgs.neovim
|
||||||
|
pkgs.stylua
|
||||||
|
];
|
||||||
|
}
|
36
vim.yml
36
vim.yml
@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
base: lua51
|
|
||||||
globals:
|
|
||||||
vim:
|
|
||||||
any: true
|
|
||||||
assert.are.same:
|
|
||||||
args:
|
|
||||||
- type: any
|
|
||||||
- type: any
|
|
||||||
assert.are_not.same:
|
|
||||||
args:
|
|
||||||
- type: any
|
|
||||||
- type: any
|
|
||||||
assert.has.error:
|
|
||||||
args:
|
|
||||||
- type: any
|
|
||||||
- type: any
|
|
||||||
assert.is_true:
|
|
||||||
args:
|
|
||||||
- type: any
|
|
||||||
- type: any
|
|
||||||
assert.is_false:
|
|
||||||
args:
|
|
||||||
- type: any
|
|
||||||
- type: any
|
|
||||||
describe:
|
|
||||||
args:
|
|
||||||
- type: string
|
|
||||||
- type: function
|
|
||||||
it:
|
|
||||||
args:
|
|
||||||
- type: string
|
|
||||||
- type: function
|
|
||||||
before_each:
|
|
||||||
args:
|
|
||||||
- type: function
|
|
Loading…
x
Reference in New Issue
Block a user