]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
CI: Checking that the reported version is actually the built one
authorMaria Matejka <mq@ucw.cz>
Thu, 24 Apr 2025 19:06:27 +0000 (21:06 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 29 Apr 2025 18:28:28 +0000 (20:28 +0200)
.gitlab-ci.yml
misc/gitlab/template.yml.j2

index 5da91bf0d75d3ac59a1bc4042f33f44a0a810195..81594b9e03232e1566b970b4ef3dd63bad56d5aa 100644 (file)
@@ -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:
index db80aa089beafcc3ebc5c9305eccf9f08dd610b9..0e29074e0103b887e279c51ace36215f6d4e6cbb 100644 (file)
@@ -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'] }}: