Skip to content

linrongbin16/ci-template.nvim

Repository files navigation

ci-template.nvim

require luarocks ci.yml codecov

CI template for Neovim plugin project.

Table of Contents

Requirements

  • CodeCov token: upload CodeCov report.
  • LuaRocks token: upload LuaRocks rockspec.

Features

For PR branch:

  1. Conventional commits check.
  2. Type check by lua-language-server.
  3. Static check by selene.
  4. Code format by stylua.
  5. Run unit tests by vusted, for both Windows and Unix/Linux, and multiple Neovim versions from lowest to nightly.
  6. Upload code coverage by luacov.

Additionally for main/master branch:

  1. Auto release.
  2. Upload LuaRocks rocks.

Usage

Initialize

  1. Click the "Use this template" button (in the top right) to create new Neovim plugin project.
  2. Go to project Settings => Security => Secrets and variables => Actions, and add below tokens:
  3. Go to project Settings => Code and automation => Actions => General => Workflow permissions, and select below options:
    • Read and write permission.
    • Allow GitHub Actions to create and approve pull requests.
  4. Clone the repository to local.
  5. Run setup.py with below arguments:
    • --org: organization.
    • --repo: repository.
    • (Optional) --indent-size: indent size, by default is 2.
    • (Optional) --required-version: minimal required nvim version, by default is 0.7.
  6. Remove setup.py and commit your first change.

Note

The setup.py script is actually doing below steps:

  1. Reset below files:
    • README.md.
    • CHANGELOG.md.
    • .release-please-manifest.json.
  2. Update below files with provided {org}, {repo} (and optional {required_version}):
    • LICENSE.
    • .luacov.
    • Action files in github/workflows.
  3. Rename below files:
    • lua/ci-template.lua to lua/{repo}.lua (.nvim suffix is been removed if exists).
    • spec/ci_template_spec.lua to spec/{repo}_spec.lua (.nvim suffix is been removed if exists).
  4. (Optional) reset the indent size with {indent_size} in below files:
    • .editorconfig.
    • .stylua.toml.
    • .nvim.lua.

Development

Setup development environment with:

To run unit tests, install below dependencies:

Then run vusted ./spec.

About

CI template for Neovim plugin project.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors