Skip to content

Commit

Permalink
Merge pull request #10 from jan-xyz/ci_tests
Browse files Browse the repository at this point in the history
add tests to CI
  • Loading branch information
Jan Steinke authored Apr 9, 2024
2 parents 6b62bd7 + 61bb869 commit b24e74b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on: [push]

jobs:

test:
name: Run Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rhysd/action-setup-vim@v1
id: vim
with:
neovim: true
version: v0.9.5

- name: Prepare dependencies
run: |
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-treesitter/nvim-treesitter ~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter
git clone --depth 1 https://github.com/nvim-neotest/nvim-nio ~/.local/share/nvim/site/pack/vendor/start/nvim-nio
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
nvim --headless -c 'TSInstallSync lua | quit'
- name: run test
run: |
nvim --version
make test
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
nvim --headless -u ./tests/minimal_init.lua -i NONE -n --noplugin -c 'PlenaryBustedDirectory tests'
2 changes: 1 addition & 1 deletion lua/lsp-preview/diff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
-- for their work <3

local lEdits = require("lsp-preview.buffer_edits")
local minidiff = require("mini.diff")

local M = {}

Expand Down Expand Up @@ -153,6 +152,7 @@ end

---@return string filetype
function Edit:preview(bufnr, winid, opts)
local minidiff = require("mini.diff")
opts = opts or {}

-- set lines in buffer to the changed output
Expand Down

0 comments on commit b24e74b

Please sign in to comment.