From 483e5af5342ece377c866f98dec56757515ca0ea Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Tue, 21 Jul 2020 15:54:27 +0200 Subject: [PATCH] Add an out-of-tree system test job to GitLab CI 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 | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 522677fcfb..df826b291d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: