From: Maria Matejka Date: Thu, 24 Apr 2025 19:06:27 +0000 (+0200) Subject: CI: Checking that the reported version is actually the built one X-Git-Tag: v2.17.1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb47e6a4e7e82540c1628e2076d82ffe30e11185;p=thirdparty%2Fbird.git CI: Checking that the reported version is actually the built one --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5da91bf0d..81594b9e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -279,6 +279,26 @@ docker-ubuntu-24.10-amd64: stage: build script: - export BRANCH=$CI_COMMIT_BRANCH + - tools/version && ( echo -n "BIRD version "; tools/version ) > version-expected + - | + STABLE_VERSION="`cat VERSION`" + if [ "$CI_COMMIT_MESSAGE" == "NEWS and version update + " ]; then + if [ "${STABLE_VERSION}" == "`tools/version`" ]; then + echo "Stable version precheck OK" + else + echo "Stable version discrepancy: $STABLE_VERSION vs. $(tools/version)" + exit 1 + fi + else + if grep -qF "BIRD version ${STABLE_VERSION}+branch" version-expected; then + true + else + echo -n "Commit $CI_COMMIT_SHA message $CI_COMMIT_MESSAGE expects version " + cat version-expected + exit 1 + fi + fi - autoreconf - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_OPTIONS # Detect which make is available @@ -288,6 +308,9 @@ docker-ubuntu-24.10-amd64: - $MAKE check # Build docs when tools are available - if which linuxdoc pdflatex sgmlsasp >/dev/null ; then $MAKE docs ; fi + # Check that the reported version is the right one + - ./bird --version |& tee obj/version-built + - diff obj/version-built version-expected .build-docker-linux-amd64: &build-docker-linux-amd64 <<: *build-base @@ -882,14 +905,14 @@ pkg-ubuntu-24.10-amd64: ## Non-linux build tests in QEMU ## ################################### .build-birdlab-base: &build-birdlab-base - <<: *test-job + <<: *build-base stage: build - script: - - export BRANCH=$CI_COMMIT_BRANCH - - autoreconf - - ./configure $CONFIGURE_OPTIONS - - gmake - - gmake check +# script: +# - export BRANCH=$CI_COMMIT_BRANCH +# - autoreconf +# - ./configure $CONFIGURE_OPTIONS +# - gmake +# - gmake check build-birdlab-openbsd-75: diff --git a/misc/gitlab/template.yml.j2 b/misc/gitlab/template.yml.j2 index db80aa089..0e29074e0 100644 --- a/misc/gitlab/template.yml.j2 +++ b/misc/gitlab/template.yml.j2 @@ -119,6 +119,26 @@ docker-{{ docker["name"] }}: stage: build script: - export BRANCH=$CI_COMMIT_BRANCH + - tools/version && ( echo -n "BIRD version "; tools/version ) > version-expected + - | + STABLE_VERSION="`cat VERSION`" + if [ "$CI_COMMIT_MESSAGE" == "NEWS and version update + " ]; then + if [ "${STABLE_VERSION}" == "`tools/version`" ]; then + echo "Stable version precheck OK" + else + echo "Stable version discrepancy: $STABLE_VERSION vs. $(tools/version)" + exit 1 + fi + else + if grep -qF "BIRD version ${STABLE_VERSION}+branch" version-expected; then + true + else + echo -n "Commit $CI_COMMIT_SHA message $CI_COMMIT_MESSAGE expects version " + cat version-expected + exit 1 + fi + fi - autoreconf - ./configure CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" $CONFIGURE_OPTIONS # Detect which make is available @@ -128,6 +148,9 @@ docker-{{ docker["name"] }}: - $MAKE check # Build docs when tools are available - if which linuxdoc pdflatex sgmlsasp >/dev/null ; then $MAKE docs ; fi + # Check that the reported version is the right one + - ./bird --version |& tee obj/version-built + - diff obj/version-built version-expected .build-docker-linux-amd64: &build-docker-linux-amd64 <<: *build-base @@ -259,14 +282,14 @@ pkg-{{ dist["name"] }}: ## Non-linux build tests in QEMU ## ################################### .build-birdlab-base: &build-birdlab-base - <<: *test-job + <<: *build-base stage: build - script: - - export BRANCH=$CI_COMMIT_BRANCH - - autoreconf - - ./configure $CONFIGURE_OPTIONS - - gmake - - gmake check +# script: +# - export BRANCH=$CI_COMMIT_BRANCH +# - autoreconf +# - ./configure $CONFIGURE_OPTIONS +# - gmake +# - gmake check {% for test in birdlab %} build-birdlab-{{ test['name'] }}: