]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add an out-of-tree system test job to GitLab CI
authorMichal Nowak <mnowak@isc.org>
Tue, 21 Jul 2020 13:54:27 +0000 (15:54 +0200)
committerMichał Kępień <michal@isc.org>
Mon, 28 Sep 2020 19:38:15 +0000 (21:38 +0200)
Make sure the new job does not get run for every pipeline as it is not
expected to break often and it is similar enough to other system test
jobs.  Change the name of the variable holding the path to the
out-of-tree build directory to a more generic one.

.gitlab-ci.yml

index 522677fcfb802c8fcfba53cf0850d8301fd5f30d..df826b291d49cf349d175169e61d462abef2f4b3 100644 (file)
@@ -207,14 +207,16 @@ stages:
   stage: build
   before_script:
     - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
-    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && mkdir "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
   script:
     - *configure
     - *check_readline_setup
     - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
     - test -z "${RUN_MAKE_INSTALL}" || make install
     - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
-    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
+    - if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
+  after_script:
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
   needs:
     - job: autoreconf
       artifacts: true
@@ -266,14 +268,20 @@ stages:
   <<: *default_triggering_rules
   stage: system
   before_script:
-    - *setup_interfaces
     - *setup_softhsm
+    # Move the artifacts from the out-of-tree build job to their original location (the out-of-tree workspace).
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}"
+    # Continue work in the out-of-tree workspace.
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
+    - *setup_interfaces
   script:
     - cd bin/tests/system
     - make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
   after_script:
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
     - test -d bind-* && cd bind-*
     - cat bin/tests/system/test-suite.log
+    - test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
 
 .system_test: &system_test_job
   <<: *system_test_common
@@ -495,7 +503,6 @@ docs:
   stage: docs
   before_script:
     - test -w "${CCACHE_DIR}" && export PATH="/usr/lib/ccache:${PATH}"
-    - test -n "${OOT_BUILD_WORKSPACE}" && mkdir "${OOT_BUILD_WORKSPACE}" && cd "${OOT_BUILD_WORKSPACE}"
   script:
     - *configure
     - make -j${BUILD_PARALLEL_JOBS:-1} -k doc V=1
@@ -709,13 +716,26 @@ gcc:out-of-tree:
   variables:
     CC: gcc
     CFLAGS: "${CFLAGS_COMMON} -Og"
-    CONFIGURE: ../configure
+    CONFIGURE: "${CI_PROJECT_DIR}/configure"
     EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb"
     RUN_MAKE_INSTALL: 1
-    OOT_BUILD_WORKSPACE: workspace
+    OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
   <<: *base_image
   <<: *build_job
 
+system:gcc:out-of-tree:
+  variables:
+    OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
+  needs:
+    - job: gcc:out-of-tree
+      artifacts: true
+  <<: *base_image
+  <<: *system_test_job
+  only:
+    - schedules
+    - tags
+    - web
+
 # Jobs for tarball GCC builds on Debian 10 "buster" (amd64)
 
 gcc:tarball: