From 997c29dbdab50c8be05af640c1ffc03aa2a7ddcb Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Thu, 15 Aug 2024 09:53:39 +0100 Subject: [PATCH] ci: fix GHA CI build matrix It would appear that requesting Go 1.21 in the build matrix has no effect whatsoever on what go toolchain is actually used to build the project. Specifying 1.22.0 in the go.mod go directive forces the 1.22 toolchain to be used for building Go source files, ignoring whatever Go version we set in the GHA CI matrix. Luckily we can enforce the right setting by setting GOTOOLCHAIN=local which forces Go to use the locally available toolchain instead of downloading the one requested by go.mod. Signed-off-by: Milos Gajdos --- .github/workflows/build.yml | 6 ++++++ go.mod | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a2adce7c..13ecc8c41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,12 @@ permissions: jobs: test: + env: + # Setting GOTOOLCHAIN to local tells go + # to to use the bundled Go version rather + # than fetching the tolchain according to + # toolchain directive found in go.mod. + GOTOOLCHAIN: local runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/go.mod b/go.mod index 576628968..0ca423f7f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/distribution/distribution/v3 -go 1.22.0 +go 1.21.0 require ( cloud.google.com/go/storage v1.30.1