Merge topic 'ci-env-scripts'

bf973c41e5 ci: Factor out scripts to add sccache to job environment
b0f7aebc77 ci: Factor out scripts to add ninja to job environment
ef3495f74f ci: Factor out scripts to add cmake to job environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9452
This commit is contained in:
Brad King
2024-04-23 11:58:01 +00:00
committed by Kitware Robot
8 changed files with 21 additions and 20 deletions

5
.gitlab/ci/cmake-env.ps1 Executable file
View File

@@ -0,0 +1,5 @@
$pwdpath = $pwd.Path
& "$pwsh" -File ".gitlab/ci/cmake.ps1"
Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
cmake --version
$cmake = "cmake"

3
.gitlab/ci/cmake-env.sh Normal file
View File

@@ -0,0 +1,3 @@
.gitlab/ci/cmake.sh
export PATH="$PWD/.gitlab/cmake/bin:$PATH"
cmake --version

3
.gitlab/ci/ninja-env.sh Normal file
View File

@@ -0,0 +1,3 @@
.gitlab/ci/ninja.sh
export PATH=$PWD/.gitlab:$PATH
ninja --version

1
.gitlab/ci/sccache-env.ps1 Executable file
View File

@@ -0,0 +1 @@
Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"

View File

@@ -0,0 +1,2 @@
.gitlab/ci/sccache.sh
export PATH="$PWD/.gitlab:$PATH"

View File

@@ -511,12 +511,8 @@
.before_script_linux: &before_script_linux
- source .gitlab/ci/env.sh
- .gitlab/ci/cmake.sh
- export PATH=$PWD/.gitlab/cmake/bin:$PATH
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PATH
- cmake --version
- ninja --version
- source .gitlab/ci/cmake-env.sh
- source .gitlab/ci/ninja-env.sh
.cmake_prep_source_linux:
stage: prep
@@ -591,8 +587,7 @@
- mkdir -p build/
- cp Utilities/Release/linux/$CMAKE_ARCH/cache.txt build/CMakeCache.txt
# Make sccache available.
- .gitlab/ci/sccache.sh
- export PATH=$PWD/.gitlab:$PATH
- source .gitlab/ci/sccache-env.sh
# Append sccache settings to the cache.
- echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
- echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt

View File

@@ -175,12 +175,8 @@
.before_script_macos: &before_script_macos
- source .gitlab/ci/env.sh
- .gitlab/ci/cmake.sh
- export PATH=$PWD/.gitlab/cmake/bin:$PATH
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PATH
- cmake --version
- ninja --version
- source .gitlab/ci/cmake-env.sh
- source .gitlab/ci/ninja-env.sh
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}

View File

@@ -386,12 +386,8 @@
.before_script_windows: &before_script_windows
- . .gitlab/ci/env.ps1
- $pwdpath = $pwd.Path
- (& "$pwsh" -File ".gitlab/ci/cmake.ps1")
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- $cmake = "cmake"
- . .gitlab/ci/cmake-env.ps1
- . .gitlab/ci/ninja-env.ps1
- cmake --version
- . .gitlab/ci/qt-env.ps1
- . .gitlab/ci/python-env.ps1
@@ -404,7 +400,7 @@
script:
- *before_script_windows
- Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
- . .gitlab/ci/sccache-env.ps1
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats