Merge pull request #18063 from roidelapluie/roidelapluie/actuallyold
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

chore: Check that previous go version check actually uses previous go version
This commit is contained in:
Julien 2026-02-11 16:32:43 +01:00 committed by GitHub
commit 19fd0b0b1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,3 +47,25 @@ if [[ "${matches}" -ne 1 ]]; then
echo 'Not all go.mod/go.work files have matching go versions'
exit 1
fi
ci_workflow=".github/workflows/ci.yml"
if [[ -f "${ci_workflow}" ]] && yq -e '.jobs.test_go_oldest' "${ci_workflow}" > /dev/null 2>&1; then
echo "Checking CI workflow test_go_oldest uses N-1 Go version"
# Extract Go version from test_go_oldest job.
get_test_go_oldest_version() {
yq '.jobs.test_go_oldest.container.image' "${ci_workflow}" \
| grep -oP 'golang-builder:1\.\K[0-9]+'
}
test_go_oldest_version="$(get_test_go_oldest_version)"
if [[ -z "${test_go_oldest_version}" || "${test_go_oldest_version}" -le 0 ]]; then
echo "Error: Could not extract Go version from test_go_oldest job in ${ci_workflow}"
exit 1
fi
if [[ "${test_go_oldest_version}" -ne "${supported_version}" ]]; then
echo "Error: test_go_oldest uses Go 1.${test_go_oldest_version}, but should use Go 1.${supported_version} (oldest supported version)"
exit 1
fi
fi