aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/lint.yml
blob: f80ce4cc563110d1730519e9df1bd1cba4f3b18c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: lint
on:
  pull_request:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.sha }}
      - run: |
          if ! bash .github/ci/lint.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}; then
            exit 1
          fi

  luacheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: lunarmodules/luacheck@v1
        with:
          args: lua/* test/*

  selene:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: NTBBloodbath/selene-action@v1.0.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --display-style=quiet .

  stylua:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: JohnnyMorganz/stylua-action@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: latest
          args: --check .

  codespell:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: pip install codespell
      - run: codespell --quiet-level=2 --check-hidden --skip=./doc/configs.md,./doc/configs.txt --ignore-words=.codespellignorewords

  commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.sha }}
      - run: npm install --save-dev @commitlint/{cli,config-conventional}
      - run: |
          echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
      - run: npx commitlint --from HEAD~1 --to HEAD --verbose