diff options
author | Brad King <brad.king@kitware.com> | 2022-12-06 13:08:56 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-12-06 08:09:07 -0500 |
commit | 6f619d2de6527fa04a78889a1cf5492cceb72408 (patch) | |
tree | 95f68224ad3093869879e193d743cbaac3f40c32 /.gitlab | |
parent | 2f5acfa801382a84b4dea2933ae4565cda239663 (diff) | |
parent | a7be3c961fd3f192fedda6244e744997be35ef7a (diff) | |
download | cmake-6f619d2de6527fa04a78889a1cf5492cceb72408.tar.gz |
Merge topic 'ci-pre-build-post-build'
a7be3c961f ci: build clang-tidy plugin in pre-build step
372ce5bffe ci: add pre-build and post-build steps to Linux
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7989
Diffstat (limited to '.gitlab')
-rwxr-xr-x | .gitlab/ci/post_build.sh | 18 | ||||
-rwxr-xr-x | .gitlab/ci/pre_build.sh | 18 | ||||
-rw-r--r-- | .gitlab/ci/pre_build_fedora37_tidy.sh (renamed from .gitlab/ci/env_fedora37_tidy.sh) | 4 | ||||
-rw-r--r-- | .gitlab/os-linux.yml | 2 |
4 files changed, 41 insertions, 1 deletions
diff --git a/.gitlab/ci/post_build.sh b/.gitlab/ci/post_build.sh new file mode 100755 index 0000000000..0edd9f6695 --- /dev/null +++ b/.gitlab/ci/post_build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +quietly() { + readonly log="/tmp/quietly-$RANDOM.log" + if ! "$@" >"$log" 2>&1; then + ret=$? + cat "$log" + rm -f "$log" + exit $ret + fi + rm -f "$log" +} + +if test -r ".gitlab/ci/post_build_${CMAKE_CONFIGURATION}.sh"; then + source ".gitlab/ci/post_build_${CMAKE_CONFIGURATION}.sh" +fi diff --git a/.gitlab/ci/pre_build.sh b/.gitlab/ci/pre_build.sh new file mode 100755 index 0000000000..7ff6a69ad3 --- /dev/null +++ b/.gitlab/ci/pre_build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +quietly() { + readonly log="/tmp/quietly-$RANDOM.log" + if ! "$@" >"$log" 2>&1; then + ret=$? + cat "$log" + rm -f "$log" + exit $ret + fi + rm -f "$log" +} + +if test -r ".gitlab/ci/pre_build_${CMAKE_CONFIGURATION}.sh"; then + source ".gitlab/ci/pre_build_${CMAKE_CONFIGURATION}.sh" +fi diff --git a/.gitlab/ci/env_fedora37_tidy.sh b/.gitlab/ci/pre_build_fedora37_tidy.sh index f9f08a3904..7580ef1506 100644 --- a/.gitlab/ci/env_fedora37_tidy.sh +++ b/.gitlab/ci/pre_build_fedora37_tidy.sh @@ -1,7 +1,9 @@ cmake \ + -G Ninja \ -S Utilities/ClangTidyModule \ -B Utilities/ClangTidyModule/build \ -DCMAKE_BUILD_TYPE=Release \ - -DRUN_TESTS=ON + -DRUN_TESTS=ON \ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache cmake --build Utilities/ClangTidyModule/build ctest --test-dir Utilities/ClangTidyModule/build --output-on-failure diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 5dbeff5e83..637df82a25 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -487,8 +487,10 @@ - .gitlab/ci/sccache.sh - sccache --start-server - sccache --show-stats + - .gitlab/ci/pre_build.sh - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake" - "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake" + - .gitlab/ci/post_build.sh - sccache --show-stats interruptible: true |