-
-
Notifications
You must be signed in to change notification settings - Fork 19
59 lines (47 loc) · 1.28 KB
/
lua-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Lua syntax check, lint, and format
on:
push:
branches:
- main
- v*
paths:
- .github/workflows/lua-check.yml
- config.lua.dist
- "data/**.lua"
pull_request:
paths:
- .github/workflows/lua-check.yml
- config.lua.dist
- "data/**.lua"
jobs:
luac:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "5.4"
- name: Test Lua syntax
run: find data/ -name '*.lua' -print0 | xargs -0 -n1 luac -p
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-luarocks@v4
- name: Install Luacheck
run: luarocks install luacheck
- name: Run Luacheck
run: luacheck data config.lua.dist || true
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: leafo/gh-actions-lua@v10
- uses: leafo/gh-actions-luarocks@v4
- name: Install LuaFormatter
run: luarocks install --server=https://luarocks.org/dev luaformatter
- name: Run LuaFormatter
run: |
find . -regex ".*\.lua.*" -exec luaformatter -i {} \;
git diff --exit-code