Skip to content

A template for Neovim plugin CI with GitHub actions

License

Notifications You must be signed in to change notification settings

lukas-reineke/ci-template.nvim

Repository files navigation

Neovim CI template

This repo is a template for Neovim plugin CI with GitHub actions
Feel free to copy into your own codebase.

What is included

On each pull request, all checks are run against the code. Example
In addition, the unit tests and Lua LS check are run against Neovim nightly once a week automatically. Example

Unit tests

Unit tests are using the plenary.nvim test harness.
Add unit tests in specs/features. Each filename has to end in _spec.lua

Unit tests on CI are run against stable and nightly versions of Neovim.

Run the tests locally with

make test

Lua LS

Lua LS checks the code for type safety using neodev.nvim types. To get the most out of this check, add types using EmmyLua to your own codebase as well. See luals.github.io/wiki/annotations for more information.

Lua LS check runs against stable and nightly versions of Neovim.

Run lua LS locally with

make lua-language-server version=stable

make lua-language-server version=nightly

Luacheck

Luacheck is an additional linter for lua. It can sometimes find issues Lua LS misses.

Run lua LS check locally with

make luacheck

Stylua

Stylua is a formatter for lua. The check will make sure all code is formatted consistently.

Run stylua locally with

make stylua

Update Versions

The stable Neovim version, and the lua LS version will need to be updated when new versions get released. To do that, open .github/workflows/nightly_check.yml and .github/workflows/pr_check.yml, and updated the values for lua_ls_version and neovim_versions.