Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tests to CI #10

Merged
merged 4 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading