CI: parametrize ccache installation path

This commit is contained in:
Vicente Adolfo Bolea Sanchez 2022-10-20 21:07:19 -04:00
parent aca3192cf8
commit 4585cc3af5
3 changed files with 7 additions and 5 deletions

@ -43,14 +43,14 @@ if(NOT DEFINED full_url)
endif() endif()
file(DOWNLOAD file(DOWNLOAD
"${full_url}" .gitlab/${tarball} "${full_url}" $ENV{CCACHE_INSTALL_DIR}/${tarball}
EXPECTED_HASH SHA256=${sha256sum} EXPECTED_HASH SHA256=${sha256sum}
SHOW_PROGRESS SHOW_PROGRESS
) )
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xf ${tarball} COMMAND ${CMAKE_COMMAND} -E tar xf ${tarball}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitlab WORKING_DIRECTORY $ENV{CCACHE_INSTALL_DIR}
RESULT_VARIABLE extract_results RESULT_VARIABLE extract_results
) )
@ -58,4 +58,4 @@ if(extract_results)
message(FATAL_ERROR "Extracting `${tarball}` failed: ${extract_results}.") message(FATAL_ERROR "Extracting `${tarball}` failed: ${extract_results}.")
endif() endif()
file(RENAME .gitlab/${filename} .gitlab/ccache) file(RENAME $ENV{CCACHE_INSTALL_DIR}/${filename} $ENV{CCACHE_INSTALL_DIR}/ccache)

@ -39,6 +39,7 @@ test:macos_xcode13:
CCACHE_COMPILERCHECK: "content" CCACHE_COMPILERCHECK: "content"
CCACHE_NOHASHDIR: "true" CCACHE_NOHASHDIR: "true"
CCACHE_RESHARE: "true" CCACHE_RESHARE: "true"
CCACHE_INSTALL_DIR: "$CI_PROJECT_DIR/.gitlab"
before_script: before_script:
- .gitlab/ci/config/cmake.sh - .gitlab/ci/config/cmake.sh
- export PATH=$PWD/.gitlab/cmake/bin:$PATH - export PATH=$PWD/.gitlab/cmake/bin:$PATH

@ -5,7 +5,8 @@
# change between the build and test stages which CMake doesn't support. # change between the build and test stages which CMake doesn't support.
# Even if we could, it could change if other runners on the machine # Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it. # could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\vtkm ci" GIT_CLONE_PATH: "$CI_BUILDS_DIR\\vtkm ci"
CCACHE_INSTALL_DIR: "$CI_PROJECT_DIR\\.gitlab"
artifacts: artifacts:
reports: reports:
junit: junit:
@ -32,7 +33,7 @@
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH" - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- "cmake --version" - "cmake --version"
- "cmake -V -P .gitlab/ci/config/ccache.cmake" - "cmake -V -P .gitlab/ci/config/ccache.cmake"
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\ccache;$env:PATH" - Set-Item -Force -Path "env:PATH" -Value "$env:CCACHE_INSTALL_DIR\ccache;$env:PATH"
- "cmake -V -P .gitlab/ci/config/ninja.cmake" - "cmake -V -P .gitlab/ci/config/ninja.cmake"
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH" - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
- "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake" - "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake"