1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 20:46:37 +08:00

ci: add pre-build step after configure but before build

This commit is contained in:
Brad King
2025-10-03 18:16:14 -04:00
parent 206b831973
commit 8d0ecda821
5 changed files with 25 additions and 0 deletions

4
.gitlab/ci/pre_build.ps1 Normal file
View File

@@ -0,0 +1,4 @@
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName
if (Test-Path -Path ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) {
. ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1"
}

18
.gitlab/ci/pre_build.sh Executable file
View 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

View File

@@ -717,6 +717,7 @@
- sccache --show-stats
- .gitlab/ci/pre_configure.sh
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- .gitlab/ci/pre_build.sh
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
- .gitlab/ci/post_build.sh
- sccache --show-stats

View File

@@ -202,6 +202,7 @@
- sccache --show-stats
- .gitlab/ci/pre_configure.sh
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- .gitlab/ci/pre_build.sh
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- .gitlab/ci/post_build.sh
- sccache --show-stats

View File

@@ -445,6 +445,7 @@
- sccache --show-stats
- (& "$pwsh" -File ".gitlab/ci/pre_configure.ps1")
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- (& "$pwsh" -File ".gitlab/ci/pre_build.ps1")
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- (& "$pwsh" -File ".gitlab/ci/post_build.ps1")
- sccache --show-stats