Skip to content

Commit 61a7e2d

Browse files
committed
ci: go cache
1 parent 7594fbe commit 61a7e2d

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

.github/workflows/checks.yml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,26 @@ jobs:
1111
name: Test
1212
runs-on: ubuntu-latest
1313
steps:
14+
- name: Check out code into the Go module directory
15+
uses: actions/checkout@v4
16+
1417
- name: Set up Go
15-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@v5
1619
with:
17-
go-version: ^1.22
18-
id: go
20+
go-version: ^1.24
1921

20-
- name: Check out code into the Go module directory
21-
uses: actions/checkout@v2
22+
- name: Cache Go modules
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.cache/go-build
27+
~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Download dependencies
33+
run: go mod download
2234

2335
- name: Run unit tests and generate the coverage report
2436
run: make test-race
@@ -27,26 +39,38 @@ jobs:
2739
name: Lint
2840
runs-on: ubuntu-latest
2941
steps:
42+
- name: Check out code into the Go module directory
43+
uses: actions/checkout@v4
44+
3045
- name: Set up Go
31-
uses: actions/setup-go@v3
46+
uses: actions/setup-go@v5
3247
with:
33-
go-version: ^1.22
34-
id: go
48+
go-version: ^1.24
3549

36-
- name: Check out code into the Go module directory
37-
uses: actions/checkout@v2
50+
- name: Cache Go modules
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
~/.cache/go-build
55+
~/go/pkg/mod
56+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-
59+
60+
- name: Download dependencies
61+
run: go mod download
3862

3963
- name: Install gofumpt
4064
run: go install mvdan.cc/[email protected]
4165

4266
- name: Install staticcheck
43-
run: go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
67+
run: go install honnef.co/go/tools/cmd/staticcheck@2025.1.1
4468

4569
- name: Install golangci-lint
46-
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
70+
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
4771

48-
- name: Install NilAway
49-
run: go install go.uber.org/nilaway/cmd/[email protected]
72+
# - name: Install NilAway
73+
# run: go install go.uber.org/nilaway/cmd/[email protected]
5074

5175
- name: Lint
5276
run: make lint

.golangci.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ linters:
1010
- gocritic
1111
- godot
1212
- godox
13-
- gomnd
1413
- mnd
1514
- lll
1615
- nestif
@@ -40,8 +39,7 @@ linters:
4039
#
4140
# Disabled because deprecated:
4241
#
43-
- execinquery
44-
- exportloopref
42+
- tenv
4543

4644
linters-settings:
4745
#

0 commit comments

Comments
 (0)