Skip to content

Commit 806142a

Browse files
authored
πŸ€– ci: run golangci-lint via go tool with vendored deps (#25)
## Summary Switch the CI lint job to run `golangci-lint` via Go tool dependencies in vendored mode, so CI can reuse vendored project deps instead of downloading modules during lint execution. ## Background The lint workflow was invoking formatter checks with `go run ...@v2.8.0`, which forces a network module download of golangci-lint and its transitive dependencies on each run. We already vendor dependencies in this repo, so lint should use that same source of truth. ## Implementation - Added `github.com/golangci/golangci-lint/v2/cmd/golangci-lint` to the `tool (...)` block in `go.mod`. - Regenerated module metadata and vendoring (`go mod tidy`, `go mod vendor`), updating `go.sum` and `vendor/`. - Updated `.github/workflows/ci.yaml` lint job to: - set `GOFLAGS: -mod=vendor` at job scope, - replace `golangci/golangci-lint-action` invocation with: - `go tool golangci-lint run --timeout=5m ./...` - `go tool golangci-lint fmt --diff` ## Validation - `go mod tidy` - `go mod vendor` - `GOPROXY=off GOFLAGS=-mod=vendor go tool golangci-lint fmt --diff` - `GOPROXY=off GOFLAGS=-mod=vendor go tool golangci-lint run --timeout=5m ./...` - `make test` - `make build` - `go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10` ## Risks - **Low functional risk**: behavior change is isolated to CI workflow/tool invocation. - **Review noise risk**: vendoring the linter introduces a large `vendor/` diff, but this is expected from pinning golangci-lint as a vendored Go tool. --- _Generated with `mux` β€’ Model: `openai:gpt-5.3-codex` β€’ Thinking: `xhigh` β€’ Cost: `$0.24`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.24 -->
1 parent c1fbc5b commit 806142a

3,584 files changed

Lines changed: 624142 additions & 1027 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.github/workflows/ci.yamlβ€Ž

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
if: github.event_name == 'merge_group' || needs.changes.outputs.go == 'true'
7575
runs-on: depot-ubuntu-24.04-8
7676
timeout-minutes: 20
77+
env:
78+
GOFLAGS: -mod=vendor
7779
steps:
7880
- name: Checkout
7981
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
@@ -98,33 +100,13 @@ jobs:
98100
git diff --exit-code -- docs/reference/api/
99101
100102
- name: Run golangci-lint
101-
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
102-
with:
103-
version: v2.8
104-
args: --timeout=5m ./...
103+
run: go tool golangci-lint run --timeout=5m ./...
105104

106105
- name: Run golangci-lint formatter checks
107-
run: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0 fmt --diff
108-
109-
- name: Detect Go version from go.mod
110-
id: govulncheck-go-version
111-
# govulncheck-action v1 passes both go-version and go-version-file to setup-go.
112-
# setup-go prioritizes go-version and warns when both are set, so we parse
113-
# go.mod ourselves and forward it via go-version-input to keep go.mod as the
114-
# single source of truth without duplicate-input warnings.
115-
run: |
116-
GO_VERSION="$(awk '/^go / { print $2; exit }' go.mod)"
117-
if [ -z "$GO_VERSION" ]; then
118-
echo "assertion failed: expected go.mod to contain a go directive" >&2
119-
exit 1
120-
fi
121-
echo "value=$GO_VERSION" >> "$GITHUB_OUTPUT"
106+
run: go tool golangci-lint fmt --diff
122107

123108
- name: Run govulncheck
124-
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1
125-
with:
126-
go-version-input: ${{ steps.govulncheck-go-version.outputs.value }}
127-
go-package: ./...
109+
run: go tool govulncheck ./...
128110

129111
test:
130112
needs: changes
@@ -235,6 +217,8 @@ jobs:
235217
runs-on: depot-ubuntu-24.04
236218
permissions:
237219
contents: read
220+
env:
221+
GOFLAGS: -mod=vendor
238222
steps:
239223
- name: Checkout
240224
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
@@ -248,7 +232,7 @@ jobs:
248232
cache: true
249233

250234
- name: Run actionlint
251-
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10
235+
run: go tool actionlint
252236

253237
- name: Run zizmor
254238
uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0

β€Žgo.modβ€Ž

Lines changed: 197 additions & 10 deletions
Large diffs are not rendered by default.

β€Žgo.sumβ€Ž

Lines changed: 508 additions & 26 deletions
Large diffs are not rendered by default.

β€Žvendor/4d63.com/gocheckcompilerdirectives/LICENSEβ€Ž

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žvendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.goβ€Ž

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žvendor/4d63.com/gochecknoglobals/LICENSEβ€Ž

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)