Skip to content

Commit

Permalink
ci: improve luacheck and commitlint integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kutsan committed Jan 25, 2025
1 parent d202254 commit 280797f
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 44 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

env:
# Disable running Husky.
HUSKY: 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
commitlint:
name: commitlint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint commit messages
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "Linting commit range for push: ${{ github.event.before }}..${{ github.sha }}"
pnpm dlx commitlint --from ${{ github.event.before }} --to ${{ github.sha }} --verbose
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
fi
luacheck:
name: Luacheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install LuaRocks
run: |
sudo apt update
sudo apt install lua5.1 luarocks
- name: Install Luacheck
run: |
luarocks install luacheck
- name: Lint Lua files
run: |
luacheck .
24 changes: 0 additions & 24 deletions .github/workflows/commitlint.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/luacheck.yml

This file was deleted.

0 comments on commit 280797f

Please sign in to comment.