-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.56 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
name: Lint & Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Go Lint Cache
uses: actions/cache@v3
with:
path: ~/.cache/golangci-lint/
key: go-lint-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-lint-cache-${{ runner.os }}-
- name: Go Mod Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
key: go-mod-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-mod-cache-${{ runner.os }}-
- name: Debug Cache Path
run: |
ls -la ~/.cache/golangci-lint/ || echo "golangci cache path does not exist"
ls -la ~/.cache/go-build || echo "go-build cache path does not exist"
- name: Check go mod
run: |
go env
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.0
install-mode: cache
args: --out-format=colored-line-number --timeout=10m --new-from-rev=HEAD~1 --config=./.golangci.yml --verbose --print-issued-lines
skip-cache: false
env:
GOLANGCI_LINT_CACHE: go-lint-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}