Skip to content

Commit 86069c3

Browse files
author
Wil T
authored
Update and rename luacheck.yml to lua.yml
1 parent d4066c6 commit 86069c3

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,38 @@ on:
33
paths:
44
- '**.lua' # Run if pushed commits include a change to a Lua (.lua) file.
55
- 'extension.xml' # Run if pushed commits include a change to extension.xml.
6-
- '.github/workflows/luacheck.yml' # Run if pushed commits change this workflow.
6+
- '.stylua' # Run if pushed commits include a change to .stylua.
7+
- '.github/workflows/lua.yml' # Run if pushed commits change this workflow.
78
pull_request:
89
paths:
910
- '**.lua' # Run if pull request includes a change to a Lua (.lua) file.
1011
- 'extension.xml' # Run if pull request includes a change to extension.xml.
12+
- '.stylua' # Run if pushed commits include a change to .stylua.
13+
schedule:
14+
- cron: '0 9 * * 1'
1115
workflow_dispatch:
1216

13-
name: Run Luacheck
17+
name: Check Lua Code
1418

1519
jobs:
16-
getnames:
20+
stylua:
1721
runs-on: ubuntu-latest
1822
steps:
1923
- name: Checkout repo
2024
uses: actions/checkout@v4
2125

26+
- uses: JohnnyMorganz/stylua-action@v4
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
version: latest
30+
args: --config-path .stylua.toml --check .
31+
32+
luacheck:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout default branch
36+
uses: actions/checkout@v4
37+
2238
# Determine extension name
2339
- name: Get Extension Name from XML
2440
id: getnamefromxml
@@ -117,27 +133,22 @@ jobs:
117133
with:
118134
string: ${{ steps.removeauthorspaces.outputs.value }}
119135

120-
outputs:
121-
extension: ${{ steps.namelowercase.outputs.lowercase }}
122-
author: ${{ steps.authorlowercase.outputs.lowercase }}
123-
124-
luacheck:
125-
runs-on: ubuntu-latest
126-
needs: getnames
127-
steps:
128-
- name: Checkout default branch
129-
uses: actions/checkout@v4
130-
131136
- name: Install Lua/LuaJIT
132137
uses: leafo/gh-actions-lua@v10
133138
with:
134139
luaVersion: 5.1
135140

136-
# Process extension code
141+
- id: cache-luacheck
142+
uses: actions/cache@v4
143+
with:
144+
path: ~/.config/luacheck
145+
key: luacheck
146+
147+
# Process extension code
137148
- name: Running luacheck
138149
uses: nebularg/actions-luacheck@v1
139150
with:
140151
files: '.'
141-
config: https://raw.githubusercontent.com/bmos/FG-luacheck/main/.luacheckrc
142-
args: '--no-color --std +${{ needs.getnames.outputs.extension }}${{ needs.getnames.outputs.author }} --exclude-files .install/*'
152+
config: https://raw.githubusercontent.com/FG-Unofficial-Developers-Guild/FG-luacheck/main/.luacheckrc
153+
args: '--no-color --std +${{ steps.namelowercase.outputs.lowercase }}${{ steps.authorlowercase.outputs.lowercase }} --exclude-files .install/*'
143154
annotate: 'warning'

0 commit comments

Comments
 (0)