-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.52 KB
/
lint.yaml
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
# every push to a branch:
# - Run Go linters.
# - Check grammar with codespell.
name: Lint
on:
pull_request:
types: [opened, synchronize]
jobs:
go_linters:
name: Run Go linters
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.23
uses: actions/setup-go@v4
with:
go-version: '1.23'
id: go
- name: Check out code
uses: actions/checkout@v3
- name: Restore Go modules
id: go-modules-cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('go.mod', 'go.sum') }}
restore-keys: |
${{ runner.os }}-gomod-
- name: Download Go modules
if: steps.go-modules-cache.outputs.cache-hit != 'true'
run: |
go mod download
echo -n "Go modules unpacked size is: " && du -sh $HOME/go/pkg/mod
- name: Run golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.61.0
./golangci-lint run --sort-results
codespell:
name: Run codespell
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Check out addon-operator code
uses: actions/checkout@v3
- name: Run codespell
run: |
pip install codespell==v1.17.1
codespell --skip=".git,go.mod,go.sum,*.log,*.gif,*.png" -L witht,eventtypes,uint,uptodate