Browse Source

ci: Factor out scripts to add sccache to job environment

Brad King 1 year ago
parent
commit
bf973c41e5
4 changed files with 5 additions and 3 deletions
  1. 1 0
      .gitlab/ci/sccache-env.ps1
  2. 2 0
      .gitlab/ci/sccache-env.sh
  3. 1 2
      .gitlab/os-linux.yml
  4. 1 1
      .gitlab/os-windows.yml

+ 1 - 0
.gitlab/ci/sccache-env.ps1

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

+ 2 - 0
.gitlab/ci/sccache-env.sh

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

+ 1 - 2
.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

+ 1 - 1
.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