@@ -24,15 +24,18 @@ jobs:
24
24
golangci :
25
25
env :
26
26
# for private repo access
27
- GOPRIVATE : github.com/initia-labs/*
27
+ GOPRIVATE : github.com/initia-labs
28
28
GITHUB_ACCESS_TOKEN : ${{ secrets.GH_READ_TOKEN }}
29
+ GOLANGCI_LINT_VERSION : v1.59.1
29
30
name : golangci-lint
30
31
runs-on : ubuntu-latest
31
32
steps :
32
- - uses : actions/setup-go@v4
33
+ - uses : actions/checkout@v4
34
+ - uses : actions/setup-go@v5
33
35
with :
34
36
go-version : 1.22
35
- - uses : technote-space/get-diff-action@v5
37
+ check-latest : true
38
+ -
uses :
technote-space/[email protected]
36
39
id : git_diff
37
40
with :
38
41
PATTERNS : |
@@ -41,26 +44,43 @@ jobs:
41
44
go.sum
42
45
# for private repo access
43
46
-
run :
git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected] /.insteadOf https://github.com/
44
- - name : run go linters
47
+ # install golangci-lint
48
+ - run : go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
49
+ - name : run go linters (long)
50
+ if : env.GIT_DIFF
51
+ id : lint_long
45
52
run : |
46
- make tools
47
53
make lint
48
- if : env.GIT_DIFF
54
+ -
uses :
technote-space/[email protected]
55
+ if : steps.lint_long.outcome == 'skipped'
56
+ with :
57
+ PATTERNS : |
58
+ **/**.go
59
+ go.mod
60
+ go.sum
61
+ - name : run go linters (short)
62
+ if : steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
63
+ run : |
64
+ make lint
65
+ env :
66
+ GIT_DIFF : ${{ env.GIT_DIFF }}
67
+ LINT_DIFF : 1
49
68
# Use --check or --exit-code when available (Go 1.19?)
50
69
# https://github.com/golang/go/issues/27005
51
70
tidy :
52
71
env :
53
72
# for private repo access
54
- GOPRIVATE : github.com/initia-labs/*
73
+ GOPRIVATE : github.com/initia-labs,github.com/skip-mev/slinky
55
74
GITHUB_ACCESS_TOKEN : ${{ secrets.GH_READ_TOKEN }}
56
75
runs-on : ubuntu-latest
57
76
name : tidy
58
77
steps :
59
- - uses : actions/checkout@v3
78
+ - uses : actions/checkout@v4
60
79
- name : Setup go
61
- uses : actions/setup-go@v4
80
+ uses : actions/setup-go@v5
62
81
with :
63
82
go-version : 1.22
83
+ check-latest : true
64
84
# for private repo access
65
85
-
run :
git config --global url.https://${GITHUB_ACCESS_TOKEN}:[email protected] /.insteadOf https://github.com/
66
86
- run : |
0 commit comments