From 1f985580ccb6ae4e6fa9f2d53607bb59d512d957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 1 Feb 2019 13:35:53 +0100 Subject: [PATCH] Test "make install" in one of the build jobs Running "make install" in a separate job in the "test" phase of a CI pipeline causes a lot of object files to be rebuilt due to the way artifacts are passed between GitLab CI jobs (object files extracted from the artifacts archive have older modification times than their respective source files checked out using Git by the worker running the "install" job). Test "make install" in one of the build jobs instead, in order to prevent object rebuilding. Using 'after_script' for this purpose was not an option because its failures are ignored. Duplicating the build script in two places would be error-prone in the long run and thus was rejected as a solution. YAML anchors would also not help in this case. A "positive" test (`test -n "${RUN_MAKE_INSTALL}" && make install`) would not work because: - it would cause the build script to fail for any job not supposed to run "make install", - appending `|| :` to the shell pipeline would prevent "make install" errors from causing a job failure. Due to the above, a "negative" test is performed, so that: - jobs not supposed to run "make install" succeed immediately, - jobs supposed to run "make install" only succeed when "make install" succeeds. (cherry picked from commit 2a231b6239278047da73649df034a1bfd7c74651) --- .gitlab-ci.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10e5e519bb5..0af2a13bcbd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,6 +109,7 @@ stages: script: - ./configure --enable-developer --with-randomdev=/dev/urandom --with-libtool --disable-static --with-cmocka --prefix=$HOME/.local --without-make-clean ${EXTRA_CONFIGURE} || cat config.log - make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1 + - test -z "${RUN_MAKE_INSTALL}" || make install artifacts: untracked: true expire_in: "1 hour" @@ -299,18 +300,10 @@ gcc:sid:amd64: CC: gcc CFLAGS: "-Wall -Wextra -O2 -g" EXTRA_CONFIGURE: "--with-libidn2" + RUN_MAKE_INSTALL: 1 <<: *debian_sid_amd64_image <<: *build_job -install:gcc:sid:amd64: - <<: *default_triggering_rules - <<: *debian_sid_amd64_image - stage: test - script: - - make install - dependencies: - - gcc:sid:amd64 - system:gcc:sid:amd64: <<: *debian_sid_amd64_image <<: *system_test_job -- GitLab