32 lines
813 B
YAML
32 lines
813 B
YAML
---
|
|
# Lint Lua code
|
|
name: Luacheck
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
luacheck:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git .
|
|
- name: Install Luacheck
|
|
run: |
|
|
if ! command -v luacheck &> /dev/null; then
|
|
if command -v luarocks &> /dev/null; then
|
|
luarocks install luacheck
|
|
else
|
|
curl -L -o luacheck.tar.gz "https://github.com/lunarmodules/luacheck/archive/refs/tags/v1.1.2.tar.gz"
|
|
tar -xzf luacheck.tar.gz
|
|
cd luacheck-*
|
|
make install
|
|
cd ..
|
|
rm -rf luacheck-*
|
|
fi
|
|
fi
|
|
- name: Run Luacheck
|
|
run: luacheck .
|