Skip to content

Commit 6135b90

Browse files
committed
Use cache for go lint actions
1 parent 06ebae7 commit 6135b90

File tree

1 file changed

+61
-10
lines changed

1 file changed

+61
-10
lines changed

.github/workflows/pull-compliance.yml

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,27 @@ jobs:
2121
with:
2222
go-version-file: go.mod
2323
check-latest: true
24-
- run: make deps-backend deps-tools
25-
- run: make lint-backend
24+
- run: make deps-backend
25+
- uses: actions/cache/restore@v4
26+
with:
27+
path: |
28+
~/.cache/golangci-lint
29+
~/.cache/gopls
30+
key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}}
2631
env:
27-
TAGS: bindata sqlite sqlite_unlock_notify
32+
GOOS: linux
33+
- uses: golangci/golangci-lint-action@v6
34+
with:
35+
version: v1.59.0
36+
skip-cache: true
37+
args: --build-tags bindata,sqlite,sqlite_unlock_notify
38+
- run: make lint-go-vet lint-go-gopls lint-editorconfig
39+
- uses: actions/cache/save@v4
40+
with:
41+
path: |
42+
~/.cache/golangci-lint
43+
~/.cache/gopls
44+
key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}}
2845

2946
lint-templates:
3047
if: needs.files-changed.outputs.templates == 'true'
@@ -94,12 +111,28 @@ jobs:
94111
with:
95112
go-version-file: go.mod
96113
check-latest: true
97-
- run: make deps-backend deps-tools
98-
- run: make lint-go-windows lint-go-vet
114+
- run: make deps-backend
115+
- uses: actions/cache/restore@v4
116+
with:
117+
path: |
118+
~/.cache/golangci-lint
119+
~/.cache/gopls
120+
key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}}
99121
env:
100-
TAGS: bindata sqlite sqlite_unlock_notify
101122
GOOS: windows
102-
GOARCH: amd64
123+
- uses: golangci/golangci-lint-action@v6
124+
with:
125+
version: v1.59.0
126+
skip-cache: true
127+
args: --build-tags bindata,sqlite,sqlite_unlock_notify
128+
env:
129+
GOOS: windows
130+
- uses: actions/cache/save@v4
131+
with:
132+
path: |
133+
~/.cache/golangci-lint
134+
~/.cache/gopls
135+
key: golangci-v1.59.0-windows-${{ runner.arch }}-${{hashFiles('go.mod')}}
103136

104137
lint-go-gogit:
105138
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
@@ -111,10 +144,28 @@ jobs:
111144
with:
112145
go-version-file: go.mod
113146
check-latest: true
114-
- run: make deps-backend deps-tools
115-
- run: make lint-go
147+
- run: make deps-backend
148+
- uses: actions/cache/restore@v4
149+
with:
150+
path: |
151+
~/.cache/golangci-lint
152+
~/.cache/gopls
153+
key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}}
116154
env:
117-
TAGS: bindata gogit sqlite sqlite_unlock_notify
155+
GOOS: linux
156+
- uses: golangci/golangci-lint-action@v6
157+
with:
158+
version: v1.59.0
159+
skip-cache: true
160+
args: --build-tags gogit,bindata,sqlite,sqlite_unlock_notify
161+
env:
162+
GOOS: linux
163+
- uses: actions/cache/save@v4
164+
with:
165+
path: |
166+
~/.cache/golangci-lint
167+
~/.cache/gopls
168+
key: golangci-v1.59.0-linux-gogit-${{ runner.arch }}-${{hashFiles('go.mod')}}
118169

119170
checks-backend:
120171
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'

0 commit comments

Comments
 (0)