Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3d592db

Browse files
committedJun 5, 2024
Use cache for go lint actions
1 parent 06ebae7 commit 3d592db

File tree

1 file changed

+62
-10
lines changed

1 file changed

+62
-10
lines changed
 

‎.github/workflows/pull-compliance.yml

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
files-changed:
1212
uses: ./.github/workflows/files-changed.yml
1313

14+
1415
lint-backend:
1516
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
1617
needs: files-changed
@@ -21,10 +22,27 @@ jobs:
2122
with:
2223
go-version-file: go.mod
2324
check-latest: true
24-
- run: make deps-backend deps-tools
25-
- run: make lint-backend
25+
- run: make deps-backend
26+
- uses: actions/cache/restore@v4
27+
with:
28+
path: |
29+
~/.cache/golangci-lint
30+
~/.cache/gopls
31+
key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}}
2632
env:
27-
TAGS: bindata sqlite sqlite_unlock_notify
33+
GOOS: linux
34+
- uses: golangci/golangci-lint-action@v6
35+
with:
36+
version: v1.59.0
37+
skip-cache: true
38+
args: --build-tags bindata,sqlite,sqlite_unlock_notify
39+
- run: make lint-go-vet lint-go-gopls lint-editorconfig
40+
- uses: actions/cache/save@v4
41+
with:
42+
path: |
43+
~/.cache/golangci-lint
44+
~/.cache/gopls
45+
key: golangci-v1.59.0-linux-${{ runner.arch }}-${{hashFiles('go.mod')}}
2846

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

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

119171
checks-backend:
120172
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'

0 commit comments

Comments
 (0)
Please sign in to comment.