|
3 | 3 | paths: |
4 | 4 | - '**.lua' # Run if pushed commits include a change to a Lua (.lua) file. |
5 | 5 | - '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. |
7 | 8 | pull_request: |
8 | 9 | paths: |
9 | 10 | - '**.lua' # Run if pull request includes a change to a Lua (.lua) file. |
10 | 11 | - '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' |
11 | 15 | workflow_dispatch: |
12 | 16 |
|
13 | | -name: Run Luacheck |
| 17 | +name: Check Lua Code |
14 | 18 |
|
15 | 19 | jobs: |
16 | | - getnames: |
| 20 | + stylua: |
17 | 21 | runs-on: ubuntu-latest |
18 | 22 | steps: |
19 | 23 | - name: Checkout repo |
20 | 24 | uses: actions/checkout@v4 |
21 | 25 |
|
| 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 | + |
22 | 38 | # Determine extension name |
23 | 39 | - name: Get Extension Name from XML |
24 | 40 | id: getnamefromxml |
@@ -117,27 +133,22 @@ jobs: |
117 | 133 | with: |
118 | 134 | string: ${{ steps.removeauthorspaces.outputs.value }} |
119 | 135 |
|
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 | | - |
131 | 136 | - name: Install Lua/LuaJIT |
132 | 137 | uses: leafo/gh-actions-lua@v10 |
133 | 138 | with: |
134 | 139 | luaVersion: 5.1 |
135 | 140 |
|
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 |
137 | 148 | - name: Running luacheck |
138 | 149 | uses: nebularg/actions-luacheck@v1 |
139 | 150 | with: |
140 | 151 | 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/*' |
143 | 154 | annotate: 'warning' |
0 commit comments