Skip to content

Commit 48926d7

Browse files
committed
Speed up CI: cache Go tools, fix golangci-lint v2 config
1 parent e2ed51d commit 48926d7

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

.github/actions/setup/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ runs:
2929
with:
3030
go-version: ${{ inputs.go-version }}
3131
go-version-file: ${{ inputs.go-version && '' || 'go.mod' }}
32-
- name: Install Go tools
33-
run: |
34-
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
35-
go install github.com/daveshanley/vacuum@latest
36-
shell: bash
3732
- name: Install dependencies
3833
run: just install
3934
shell: bash

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ jobs:
1313
uses: actions/checkout@v6
1414
- name: Run Common Setup
1515
uses: ./.github/actions/setup
16+
- name: Cache Go tools
17+
uses: actions/cache@v5
18+
with:
19+
path: |
20+
~/go/bin/golangci-lint
21+
~/go/bin/vacuum
22+
key: go-tools-${{ runner.os }}-${{ hashFiles('go.mod') }}
23+
restore-keys: go-tools-${{ runner.os }}-
24+
- name: Install Go tools
25+
run: |
26+
test -x ~/go/bin/golangci-lint || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
27+
test -x ~/go/bin/vacuum || go install github.com/daveshanley/vacuum@latest
1628
- name: Build Templates
1729
run: just build-templates
1830
- name: Run Linter

.golangci.yaml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ linters:
1919
- staticcheck
2020
- unparam
2121
- usestdlibvars
22+
settings:
23+
gocyclo:
24+
min-complexity: 20
25+
dupl:
26+
threshold: 100
27+
goconst:
28+
min-len: 3
29+
min-occurrences: 3
30+
mnd:
31+
ignored-numbers:
32+
- "0"
33+
- "1"
34+
- "2"
35+
- "10"
36+
- "100"
37+
ignored-functions:
38+
- "time.*"
39+
- "http.StatusText"
2240
exclusions:
2341
rules:
2442
- path: _test\.go
@@ -41,22 +59,3 @@ formatters:
4159
gofumpt:
4260
extra-rules: true
4361
module-path: pkgstatsd
44-
45-
linters-settings:
46-
gocyclo:
47-
min-complexity: 15
48-
dupl:
49-
threshold: 100
50-
goconst:
51-
min-len: 3
52-
min-occurrences: 3
53-
mnd:
54-
ignored-numbers:
55-
- "0"
56-
- "1"
57-
- "2"
58-
- "10"
59-
- "100"
60-
ignored-functions:
61-
- "time.*"
62-
- "http.StatusText"

0 commit comments

Comments
 (0)