Skip to content

Commit 5af4c47

Browse files
committed
ci: add additional checks, rename ci to tests
1 parent 23e1d0b commit 5af4c47

File tree

6 files changed

+77
-0
lines changed

6 files changed

+77
-0
lines changed

.github/workflows/format.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Format
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
format:
7+
name: Stylua
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v5
11+
- run: date +%W > weekly
12+
13+
- name: Restore cache
14+
id: cache
15+
uses: actions/cache@v4
16+
with:
17+
path: |
18+
~/.cargo/bin
19+
key: ${{ runner.os }}-cargo-${{ hashFiles('weekly') }}
20+
21+
- name: Install
22+
if: steps.cache.outputs.cache-hit != 'true'
23+
run: cargo install stylua
24+
25+
- name: Format
26+
run: stylua --check lua/ --config-path=.stylua.toml

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
name: Luacheck
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v5
11+
- name: Setup
12+
run: |
13+
sudo apt-get update
14+
sudo apt-get install luarocks -y
15+
sudo luarocks install luacheck
16+
17+
- name: Lint
18+
run: luacheck lua/ --globals vim
File renamed without changes.

.github/workflows/typecheck.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: lua_ls-typecheck
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: Type Check Code Base
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v5
12+
- uses: stevearc/nvim-typecheck-action@v2
13+
with:
14+
level: Warning
15+
configpath: ".luarc.json"

.luacheckrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---@diagnostic disable-next-line: lowercase-global
2+
globals = { "vim", "describe", "it", "before_each", "after_each", "assert", "async", "MiniTest" }

.luarc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"runtime": {
3+
"version": "LuaJIT",
4+
"pathStrict": true
5+
},
6+
"type": {
7+
"checkTableShape": true
8+
},
9+
"diagnostics.globals": [
10+
"describe",
11+
"it",
12+
"before_each",
13+
"MiniTest",
14+
"after_each"
15+
]
16+
}

0 commit comments

Comments
 (0)