ci: added check workflow for linting rockspecs #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check | |
on: | |
push: | |
branches: | |
- main | |
- 'renovate/**' | |
paths: | |
- .github/workflows/check.yml | |
- '**.rockspec' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/check.yml | |
- '**.rockspec' | |
workflow_dispatch: | |
jobs: | |
lint-rockspecs: | |
name: Lint Rockspecs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup Lua | |
uses: leafo/[email protected] | |
- name: Setup LuaRocks | |
uses: leafo/[email protected] | |
- name: Run luarocks lint | |
run: | | |
shopt -s nullglob | |
rockspecs=(*.rockspec **/*.rockspec) | |
if [[ "${#rockspecs[@]}" -eq 0 ]]; then | |
echo "No rockspecs found" | |
exit 1 | |
fi | |
for rockspec in "${rockspecs[@]}"; do | |
echo "Linting $rockspec" | |
luarocks lint "$rockspec" | |
done |