Skip to content

Commit

Permalink
ci: added check workflows workflow and added problem matcher for luac…
Browse files Browse the repository at this point in the history
…heck
  • Loading branch information
jonasgeiler committed Sep 19, 2024
1 parent 2f043cb commit f0c2f7a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/check-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Check Workflows

on:
push:
branches:
- main
- 'renovate/**'
paths:
- '.github/workflows/**.yml'

pull_request:
branches:
- main
paths:
- '.github/workflows/**.yml'

workflow_dispatch:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Run actionlint on GitHub Actions workflows
env:
# renovate: datasource=github-releases depName=rhysd/actionlint
ACTIONLINT_VERSION: v1.7.0
run: |
IFS=$' \t\n'; set -euxo pipefail
# download, extract and setup actionlint
wget -q "https://github.com/rhysd/actionlint/releases/download/${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION#v}_linux_amd64.tar.gz" \
-O actionlint.tar.gz
tar -xzf actionlint.tar.gz
chmod +x actionlint
# download and setup problem matcher for actionlint
wget -q "https://raw.githubusercontent.com/rhysd/actionlint/${ACTIONLINT_VERSION}/.github/actionlint-matcher.json" \
-O actionlint-problem-matcher.json
echo "::add-matcher::actionlint-problem-matcher.json"
# run actionlint
./actionlint -verbose -color
17 changes: 16 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,19 @@ jobs:
uses: hishamhm/gh-actions-luarocks@master

- name: Run luacheck on Lua files
run: luarocks install luacheck && luacheck . --no-cache --formatter TAP --include-files "joysticktester/**/*.lua"
env:
# renovate: datasource=github-releases depName=ammaraskar/msvc-problem-matcher
MSCV_PROBLEM_MATCHER_VERSION: 0.3.0
run: |
IFS=$' \t\n'; set -euxo pipefail
# install luacheck
luarocks install luacheck
# download and setup problem matcher for luacheck's visual_studio formatter
wget -q "https://raw.githubusercontent.com/ammaraskar/msvc-problem-matcher/${MSCV_PROBLEM_MATCHER_VERSION}/msvc_matcher.json" \
-O visual-studio-problem-matcher.json
echo "::add-matcher::visual-studio-problem-matcher.json"
# run luacheck
luacheck . --no-cache --formatter visual_studio --include-files "joysticktester/**/*.lua"

0 comments on commit f0c2f7a

Please sign in to comment.