Skip to content

Commit

Permalink
ci: type check the codebase using luacats and lua-typecheck-action
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed May 21, 2024
1 parent 6f27462 commit b0e8d2d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/.luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.runtime.version": "LuaJIT",
"Lua.runtime.path": ["lua/?.lua", "lua/?/init.lua"],
"Lua.workspace.library": [
"/home/runner/work/yazi.nvim/yazi.nvim/lua_modules/share/lua/5.1",
"/home/runner/work/yazi.nvim/yazi.nvim/deps/neovim/runtime/lua",
"/home/runner/work/yazi.nvim/yazi.nvim/deps/neodev.nvim/types/stable",
"/home/runner/work/yazi.nvim/yazi.nvim/deps/plenary.nvim"
],
"Lua.diagnostics.libraryFiles": "Disable",
"Lua.workspace.checkThirdParty": "Disable"
}
50 changes: 50 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# copied from https://github.com/nvim-neorg/neorg/blob/1e63f84f04caed4b8831b8122c4ba2e7dbda389f/.github/workflows/typecheck.yml#L17
name: lua_ls-typecheck
on:
pull_request: ~
push:
branches:
- "*"

jobs:
build:
name: Type Check Code Base
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Checkout dependency neodev # get neodev and neovim/runtime for builtin types
uses: actions/checkout@v4
with:
repository: "folke/neodev.nvim"
path: "deps/neodev.nvim"

- name: Checkout dependency plenary
uses: actions/checkout@v4
with:
repository: "nvim-lua/plenary.nvim"
path: "deps/plenary.nvim"

- name: Checkout neovim for type annotations
uses: actions/checkout@v3
with:
repository: "neovim/neovim"
path: "deps/neovim"

- uses: leafo/gh-actions-lua@v9 # get luarocks dependencies for their types (eg `PathlibPath`)
with:
luaVersion: "5.1"
- uses: leafo/gh-actions-luarocks@v4
- name: install dependencies
run: |
luarocks init
luarocks install --only-deps ./*.rockspec
- name: Typecheck the code base
uses: mrcjkb/[email protected]
with:
configpath: .github/workflows/.luarc.json
directories: |
lua
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# 🎲 A Neovim Plugin for [yazi](https://github.com/sxyazi/yazi.git)

<a href="https://dotfyle.com/plugins/mikavilpas/yazi.nvim">
<img src="https://dotfyle.com/plugins/mikavilpas/yazi.nvim/shield?style=flat-square" alt="shield image for plugin usage" />
</a>
<img src="https://dotfyle.com/plugins/mikavilpas/yazi.nvim/shield?style=flat-square" alt="shield image for plugin usage" /> </a>

[![Type checked codebase](https://github.com/mrcjkb/lua-typecheck-action/actions/workflows/typecheck.yml/badge.svg)](https://github.com/mrcjkb/lua-typecheck-action/actions/workflows/typecheck.yml)

Yazi is a blazing fast file manager for the terminal. This plugin allows you to
open yazi in a floating window in Neovim.
Expand Down

0 comments on commit b0e8d2d

Please sign in to comment.