From bf973c41e53adbe21a415c8855dbf4c9fc990c90 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 Apr 2024 18:20:47 -0400 Subject: ci: Factor out scripts to add sccache to job environment --- .gitlab/ci/sccache-env.ps1 | 1 + .gitlab/ci/sccache-env.sh | 2 ++ .gitlab/os-linux.yml | 3 +-- .gitlab/os-windows.yml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100755 .gitlab/ci/sccache-env.ps1 create mode 100644 .gitlab/ci/sccache-env.sh diff --git a/.gitlab/ci/sccache-env.ps1 b/.gitlab/ci/sccache-env.ps1 new file mode 100755 index 0000000..66dc6eb --- /dev/null +++ b/.gitlab/ci/sccache-env.ps1 @@ -0,0 +1 @@ +Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH" diff --git a/.gitlab/ci/sccache-env.sh b/.gitlab/ci/sccache-env.sh new file mode 100644 index 0000000..4b170a4 --- /dev/null +++ b/.gitlab/ci/sccache-env.sh @@ -0,0 +1,2 @@ +.gitlab/ci/sccache.sh +export PATH="$PWD/.gitlab:$PATH" diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 274b62e..03778c2 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -587,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 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index a0e22bf..1372136 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -400,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 -- cgit v0.12