Github action for typechecking a neovim plugin
If you are using the type annotations from LuaLS, this action will typecheck your plugin.
Create the file .github/workflows/typecheck.yml
with the following contents:
---
name: Type check
on:
pull_request: ~
push:
branches:
- master
jobs:
build:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: stevearc/nvim-typecheck-action@v2
The following optional inputs can be specified using with:
The path to typecheck
- uses: stevearc/nvim-typecheck-action@v2
with:
path: lua
The minimum level of diagnostic that should be logged. One of Error
, Warning
, or Information
- uses: stevearc/nvim-typecheck-action@v2
with:
level: Error
Path to a luarc.json
file
- uses: stevearc/nvim-typecheck-action@v2
with:
configpath: ".luarc.json"
Space-separated list of github repos to add to the library path. Use this if your plugin depends on types that are declared in another plugin.
- uses: stevearc/nvim-typecheck-action@v2
with:
libraries: |
https://github.com/nvim-neotest/neotest
Which version of Neovim to use to run the check.
- uses: stevearc/nvim-typecheck-action@v2
with:
nvim-version: v0.10.0
Which version of lua-language-server to use to run the check.
- uses: stevearc/nvim-typecheck-action@v2
with:
luals-version: 3.9.1