blob: 6e0d6d45ba0a66619bd1b1b8723989c52a49be1b (
plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
|
name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ruff:
name: Python (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
with:
args: check --output-format=github
- uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
with:
args: format --check
shellcheck:
name: Shell (shellcheck)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run shellcheck
run: |
shfiles=$(find plugins -name "*.sh" -type f 2>/dev/null)
if [ -n "$shfiles" ]; then
echo "$shfiles" | xargs shellcheck -x
else
echo "No shell scripts found, skipping"
fi
shfmt:
name: Shell (shfmt)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install shfmt
run: |
curl -sS https://webinstall.dev/shfmt | bash
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Run shfmt
run: |
shfiles=$(find plugins -name "*.sh" -type f 2>/dev/null)
if [ -n "$shfiles" ]; then
echo "$shfiles" | xargs shfmt -i 2 -ci -d
else
echo "No shell scripts found, skipping"
fi
bats:
name: Shell (bats)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install bats and uv
run: |
sudo apt-get update
sudo apt-get install -y bats
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Run hook tests
run: |
batfiles=$(find plugins -name "*.bats" -type f 2>/dev/null)
if [ -n "$batfiles" ]; then
echo "$batfiles" | xargs bats
else
echo "No bats test files found, skipping"
fi
|