ci: add pre-build and post-build steps to Linux
The pre-build step will allow actions to be executed before the CMake build but after Ninja and sccache have been downloaded, so they can be used in the pre-build step. The env step is meant for setting up environment variables anyway, rather than performing actions. The post-build step will allow extra artifacts to be computed after the build is complete.
This commit is contained in:
parent
e0a35098bb
commit
372ce5bffe
18
.gitlab/ci/post_build.sh
Executable file
18
.gitlab/ci/post_build.sh
Executable file
@ -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
|
18
.gitlab/ci/pre_build.sh
Executable file
18
.gitlab/ci/pre_build.sh
Executable file
@ -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
|
@ -465,8 +465,10 @@
|
|||||||
- .gitlab/ci/sccache.sh
|
- .gitlab/ci/sccache.sh
|
||||||
- sccache --start-server
|
- sccache --start-server
|
||||||
- sccache --show-stats
|
- sccache --show-stats
|
||||||
|
- .gitlab/ci/pre_build.sh
|
||||||
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||||
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
|
||||||
|
- .gitlab/ci/post_build.sh
|
||||||
- sccache --show-stats
|
- sccache --show-stats
|
||||||
|
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
Loading…
Reference in New Issue
Block a user