]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
CI: fix test collisions between branches (again)
authorMaria Matejka <mq@ucw.cz>
Tue, 17 Dec 2024 11:38:12 +0000 (12:38 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 8 Apr 2025 13:40:28 +0000 (15:40 +0200)
The build-netlab job was side-effecting the test-* jobs,
and if for some reason Gitlab scheduled build-netlab before
other pipeline's test-* jobs finished, these jobs got a wrong
binary, possibly failing. Solved by using explicit artifacts, which is
not the fastest way to do this (we could keep the binaries named there)
but it's the gitlab-right way to do this.

(Re-committed, was accidentally removed by one of previous commits)

.gitlab-ci.yml

index 25cb9fc50843c361976478b0ab6208d45ec21bce..65039bcb2b0618813ae40e45fdbdb1f1e9896af1 100644 (file)
@@ -691,19 +691,22 @@ pkg-ubuntu-24.10-amd64:
 
 build-netlab:
   stage: build
+  variables:
+    BDIR: build-netlab
   tags:
     - netlab
     - amd64
   script:
-    - DIR=$(pwd)
     - autoreconf
-    - ./configure
+    - mkdir $BDIR
+    - cd $BDIR
+    - ../configure
     - BRANCH=$CI_COMMIT_BRANCH make
-    - cd $TOOLS_DIR
-    - sudo git clean -fx
-    - git pull --ff-only
-    - mv $DIR/bird $DIR/birdc netlab/common
-    - ln -s $STAYRTR_BINARY netlab/common/stayrtr
+  artifacts:
+    paths:
+      - $BDIR/bird
+      - $BDIR/birdc
+    expire_in: 2 hours
 
 .test: &test-base
   stage: test
@@ -712,7 +715,13 @@ build-netlab:
     - netlab
     - amd64
   script:
-    - cd $TOOLS_DIR/netlab
+    - DIR=$(pwd)
+    - cd $TOOLS_DIR
+    - sudo git clean -fx
+    - git pull --ff-only
+    - mv $DIR/build-netlab/* netlab/common/
+    - ln -s $STAYRTR_BINARY netlab/common/stayrtr
+    - cd netlab
     - sudo ./stop
     - sudo ./runtest -s v2 -m check $TEST_NAME