ci: added test-build step to check workflow #2
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' | |
- src | |
pull_request: | |
branches: | |
- main | |
paths: | |
- .github/workflows/check.yml | |
- '**.rockspec' | |
- src | |
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 | |
test-build: | |
name: Test Build | |
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 build | |
run: luarocks build |