From 277a37514e057ec5b86d14633bfc9c1e909cfa07 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 13 Oct 2026 09:14:12 -0700 Subject: [PATCH 1/4] ci: bump actions/checkout and actions/setup-go to v7 This also gets rid of the "Node.js 20 is deprecated" warnings. Since v6, actions/setup-go sets GOTOOLCHAIN=local for all subsequent steps, so we no longer need to set it explicitly. Signed-off-by: Kir Kolyshkin --- .github/workflows/build.yml | 8 ++------ .github/workflows/lint.yml | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62431b3c9..7fcd12682 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,16 +17,12 @@ jobs: # our oldest (officially) supported version and the two upstream-supported versions go: [1.21.x, oldstable, stable] - env: - # avoid downloading any alternate toolchains (https://go.dev/doc/toolchain) - GOTOOLCHAIN: local - steps: - name: checkout source code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: setup go environment - uses: actions/setup-go@v5 + uses: actions/setup-go@v7 with: go-version: ${{ matrix.go }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5c30099ea..0efb82a70 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Run make -C schema fmt run: make -C schema fmt - name: Check for changes @@ -16,7 +16,7 @@ jobs: codespell: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: install deps run: pip install --break-system-packages codespell==v2.4.1 - name: run codespell From 7182f7a1ab389074fcc29371fc798479f5e65bda Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 13 Oct 2026 09:24:49 -0700 Subject: [PATCH 2/4] Makefile: remove test, .govet and unused variables The "test" target depends on .golint, which was removed by commit 15d2a5a ("Switch Go linting to use golangci-lint"), so "make test" fails with: make: *** No rule to make target '.golint', needed by 'test'. Stop. Since CI does not use it, and it makes little sense locally, remove it. The .govet target is redundant, since golangci-lint's govet linter runs all the "go vet" analyzers (and also checks schema/validate, which .govet does not). Remove it, and its use from CI. Remove HOST_GOLANG_VERSION and ALLOWED_GO_VERSION variables, which were only used by the (removed) .golint target. Signed-off-by: Kir Kolyshkin --- .github/workflows/build.yml | 2 -- Makefile | 9 --------- 2 files changed, 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7fcd12682..ebc59de0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,6 @@ jobs: set -x make install.tools - make .govet - make .gitvalidation make docs make -C schema test diff --git a/Makefile b/Makefile index 9d2bd3611..4eec80c21 100644 --- a/Makefile +++ b/Makefile @@ -54,15 +54,6 @@ endif version.md: ./specs-go/version.go go run ./.tool/version-doc.go > $@ -HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-) -# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked. -ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' = '$(1)' && echo 'true') - -test: .govet .golint .gitvalidation - -.govet: - go vet -x ./... - # When this is running in GitHub, it will only check the GitHub commit range .gitvalidation: @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) From bc2cd87d6eeb3b51ef2be0ef4c7d150c7d55bbbf Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 13 Oct 2026 09:24:49 -0700 Subject: [PATCH 3/4] Makefile: add lint target Add a "lint" target which runs golangci-lint for both the main module and schema/validate. Signed-off-by: Kir Kolyshkin --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 4eec80c21..bf058ba37 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,11 @@ endif version.md: ./specs-go/version.go go run ./.tool/version-doc.go > $@ +.PHONY: lint +lint: + golangci-lint run + cd schema/validate && golangci-lint run --path-prefix schema/validate + # When this is running in GitHub, it will only check the GitHub commit range .gitvalidation: @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) From 8806527d2fbf6b491f65d24a65ab5c7ef84bd6a3 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 13 Oct 2026 09:12:08 -0700 Subject: [PATCH 4/4] ci: move golangci-lint to lint.yml Running golangci-lint for every Go version in the build matrix is redundant, as the results are the same. Move it to a separate job in lint.yml, so it runs once. Pin the Go version to the one golangci-lint v2.14 is built with (1.27), rather than using "stable", so that a new Go release does not unexpectedly break the linter; bump both versions together. Signed-off-by: Kir Kolyshkin --- .github/workflows/build.yml | 11 ----------- .github/workflows/lint.yml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebc59de0b..07deb7fcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,17 +26,6 @@ jobs: with: go-version: ${{ matrix.go }} - - name: install golangci-lint - uses: golangci/golangci-lint-action@v9 - with: - version: v2.14 - install-only: true - - - name: run golangci-lint - run: | - golangci-lint run - cd schema/validate && golangci-lint run --path-prefix schema/validate - - name: run tests run: | set -x diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0efb82a70..3f1f3a757 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,22 @@ name: Lint on: [push, pull_request] jobs: + golangci-lint: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 + with: + # Keep in sync with the Go version golangci-lint is built with. + go-version: 1.27.x + - name: install golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: v2.14 + install-only: true + - name: run golangci-lint + run: make lint + check-format: runs-on: ubuntu-24.04 steps: