Skip to content

Commit 896c4be

Browse files
kolyshkinlifubang
authored andcommitted
ci: add checking Go version from Dockerfile
This is to ensure that Go version in Dockerfile (which is used to build release binaries) is: - currently supported; - used in CI tests. Signed-off-by: Kir Kolyshkin <[email protected]> (cherry picked from commit df4acc8) Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent cb40164 commit 896c4be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/validate.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,18 @@ jobs:
197197
make cfmt
198198
git diff --exit-code
199199
200+
check-go:
201+
runs-on: ubuntu-24.04
202+
steps:
203+
- uses: actions/checkout@v5
204+
- name: check Go version
205+
run: |
206+
GO_VER=$(awk -F= '/^ARG\s+GO_VERSION=/ {print $2; quit}' Dockerfile)
207+
echo "Go version used in Dockerfile: $GO_VER"
208+
echo -n "Checking if Go $GO_VER is supported ... "
209+
curl -fsSL https://go.dev/dl/?mode=json | jq -e 'any(.[]; .version | startswith("go'$GO_VER'"))'
210+
echo -n "Checking if Go $GO_VER is tested against ... "
211+
yq -e '.jobs.test.strategy.matrix.go-version | contains(["'$GO_VER'.x"])' .github/workflows/test.yml
200212
201213
release:
202214
timeout-minutes: 30
@@ -253,6 +265,7 @@ jobs:
253265
254266
all-done:
255267
needs:
268+
- check-go
256269
- cfmt
257270
- codespell
258271
- commit

0 commit comments

Comments
 (0)