Skip to content

Commit 55f878b

Browse files
committed
Use the Go toolchain installed by actions/setup-go
Since version 1.21, Go may automatically download a different version of Go. Disable this behavior so that entire pipelines use only one version. The "go" and "toolchain" directives indicate the minimum version of Go required when importing and developing the module, respectively. We are concerned only with compatibility, so downgrade "toolchain" to 1.22.0. Issue: PGO-1898 See: https://go.dev/doc/toolchain
1 parent 0f21106 commit 55f878b

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

.github/workflows/codeql-analysis.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
schedule:
1010
- cron: '10 18 * * 2'
1111

12+
env:
13+
# Use the Go toolchain installed by setup-go
14+
# https://github.com/actions/setup-go/issues/457
15+
GOTOOLCHAIN: local
16+
1217
jobs:
1318
analyze:
1419
runs-on: ubuntu-latest

.github/workflows/lint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Linters
33
on:
44
pull_request:
55

6+
env:
7+
# Use the Go toolchain installed by setup-go
8+
# https://github.com/actions/setup-go/issues/457
9+
GOTOOLCHAIN: local
10+
611
jobs:
712
golangci-lint:
813
runs-on: ubuntu-latest

.github/workflows/test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
- main
88
- master
99

10+
env:
11+
# Use the Go toolchain installed by setup-go
12+
# https://github.com/actions/setup-go/issues/457
13+
GOTOOLCHAIN: local
14+
1015
jobs:
1116
go-test:
1217
runs-on: ubuntu-latest
@@ -35,7 +40,6 @@ jobs:
3540
- run: ENVTEST_K8S_VERSION="${KUBERNETES#default}" make check-envtest
3641
env:
3742
KUBERNETES: "${{ matrix.kubernetes }}"
38-
GOEXPERIMENT: nocoverageredesign # https://go.dev/issue/65653
3943
GO_TEST: go test --coverprofile 'envtest.coverage' --coverpkg ./internal/...
4044

4145
# Upload coverage to GitHub
@@ -71,7 +75,6 @@ jobs:
7175
- run: make createnamespaces check-envtest-existing
7276
env:
7377
PGO_TEST_TIMEOUT_SCALE: 1.2
74-
GOEXPERIMENT: nocoverageredesign # https://go.dev/issue/65653
7578
GO_TEST: go test --coverprofile 'envtest-existing.coverage' --coverpkg ./internal/...
7679

7780
# Upload coverage to GitHub

.github/workflows/trivy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
- main
88
- master
99

10+
env:
11+
# Use the Go toolchain installed by setup-go
12+
# https://github.com/actions/setup-go/issues/457
13+
GOTOOLCHAIN: local
14+
1015
jobs:
1116
licenses:
1217
runs-on: ubuntu-latest

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/crunchydata/postgres-operator
22

33
go 1.22.0
44

5-
toolchain go1.22.4
6-
75
require (
86
github.com/go-logr/logr v1.4.2
97
github.com/golang-jwt/jwt/v5 v5.2.1

0 commit comments

Comments
 (0)