-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (73 loc) · 2.37 KB
/
lint.yml
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
69
70
71
72
73
74
name: Lint
on:
pull_request:
paths:
# actionlint
- ".github/workflows/*.yml"
# prettier
- "**.md"
- "**.yml"
- "**.json"
# shellcheck & shfmt
- "**.sh"
jobs:
validate-renovate-config:
name: Validate renovate config
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install -g renovate
- name: Validate config
run: renovate-config-validator .github/renovate.json
actionlint:
name: Actionlint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Actionlint
env:
version: "1.7.1"
run: curl -Ls "https://github.com/rhysd/actionlint/releases/download/v${{ env.version }}/actionlint_${{ env.version }}_linux_amd64.tar.gz" | sudo tar -x -z -C /usr/local/bin actionlint
- name: Run Actionlint
run: |
echo "::add-matcher::.github/matcher-actionlint.json"
actionlint -color
prettier:
runs-on: ubuntu-22.04
name: Prettier
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bunx prettier -c .
shellcheck:
runs-on: ubuntu-22.04
name: Shellcheck
steps:
- uses: actions/checkout@v4
- name: Install Shellcheck
env:
version: "0.10.0"
run: curl -Ls "https://github.com/koalaman/shellcheck/releases/download/v${{ env.version }}/shellcheck-v${{ env.version }}.linux.x86_64.tar.xz" | sudo tar -x -J --wildcards --strip-components=1 -C /usr/local/bin "shellcheck*/shellcheck"
- name: Verify shell scripts
run: |
echo "::add-matcher::.github/matcher-shellcheck.json"
shellcheck -f gcc -S warning hadolint.sh install.sh lib/*.sh test/*.sh
shfmt:
name: Shfmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install shfmt
env:
version: "3.9.0"
run: curl -Ls -o shfmt "https://github.com/mvdan/sh/releases/download/v${{ env.version }}/shfmt_v${{ env.version }}_linux_amd64" && chmod +x shfmt && sudo mv shfmt /usr/local/bin
- name: Lint shell scripts
run: shfmt -i 2 -d hadolint.sh install.sh lib/*.sh test/*.sh
typos:
name: Typos
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/[email protected]