mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
CI: download/install cmake in each build
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
This commit is contained in:
parent
09e508cd86
commit
4b6175980c
@ -122,11 +122,21 @@ stages:
|
||||
- build
|
||||
- test
|
||||
|
||||
.use_minimum_supported_cmake:
|
||||
variables:
|
||||
CMAKE_VERSION: "3.13.5"
|
||||
|
||||
.install_cmake: &install_cmake |
|
||||
export PATH=$PWD/.gitlab/cmake/bin:$PATH
|
||||
.gitlab/ci/config/cmake.sh "$CMAKE_VERSION"
|
||||
cmake --version
|
||||
|
||||
.cmake_build_linux: &cmake_build_linux
|
||||
stage: build
|
||||
timeout: 2 hours
|
||||
interruptible: true
|
||||
before_script:
|
||||
- *install_cmake
|
||||
- .gitlab/ci/config/sccache.sh
|
||||
- export PATH=$PWD/.gitlab:$PATH
|
||||
- SCCACHE_IDLE_TIMEOUT=0 sccache --start-server
|
||||
@ -171,12 +181,10 @@ stages:
|
||||
stage: test
|
||||
timeout: 50 minutes
|
||||
interruptible: true
|
||||
before_script:
|
||||
- *install_cmake
|
||||
script:
|
||||
#Need to use our custom ctest-latest symlink
|
||||
#This will allow us to use 3.17+ which has support
|
||||
#for running failed tests multiple times so failures
|
||||
#due to system load are not reported
|
||||
- "ctest-latest -VV -S .gitlab/ci/ctest_test.cmake"
|
||||
- "ctest -VV -S .gitlab/ci/ctest_test.cmake"
|
||||
artifacts:
|
||||
expire_in: 24 hours
|
||||
when: always
|
||||
@ -199,8 +207,10 @@ stages:
|
||||
stage: test
|
||||
timeout: 2 hours
|
||||
interruptible: true
|
||||
before_script:
|
||||
- *install_cmake
|
||||
script:
|
||||
- "ctest-latest -VV -S .gitlab/ci/ctest_memcheck.cmake"
|
||||
- "ctest -VV -S .gitlab/ci/ctest_memcheck.cmake"
|
||||
artifacts:
|
||||
expire_in: 24 hours
|
||||
when: always
|
||||
|
@ -13,6 +13,7 @@ build:centos7_gcc73:
|
||||
- .centos7
|
||||
- .cmake_build_linux
|
||||
- .only-default
|
||||
- .use_minimum_supported_cmake
|
||||
variables:
|
||||
CMAKE_BUILD_TYPE: RelWithDebInfo
|
||||
CMAKE_GENERATOR: "Unix Makefiles"
|
||||
|
19
.gitlab/ci/config/cmake.ps1
Executable file
19
.gitlab/ci/config/cmake.ps1
Executable file
@ -0,0 +1,19 @@
|
||||
$erroractionpreference = "stop"
|
||||
|
||||
$version = "3.21.1"
|
||||
$sha256sum = "9fba6df0b89be0dc0377f2e77ca272b3f8c38691fe237699de275ea0c2254242"
|
||||
$filename = "cmake-$version-windows-x86_64"
|
||||
$tarball = "$filename.zip"
|
||||
|
||||
$outdir = $pwd.Path
|
||||
$outdir = "$outdir\.gitlab"
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
|
||||
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
|
||||
if ($hash.Hash -ne $sha256sum) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
|
||||
Move-Item -Path "$outdir\$filename" -Destination "$outdir\cmake"
|
56
.gitlab/ci/config/cmake.sh
Executable file
56
.gitlab/ci/config/cmake.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2079
|
||||
|
||||
set -x
|
||||
|
||||
version="${1:-3.21.1}"
|
||||
|
||||
# We require CMake >= 3.13 in the CI to support CUDA builds
|
||||
readonly -A linuxParamsByVersion=(
|
||||
['3.13.5']='e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864 Linux'
|
||||
['3.21.1']='bf496ce869d0aa8c1f57e4d1a2e50c8f2fb12a6cd7ccb37ad743bb88f6b76a1e linux'
|
||||
)
|
||||
|
||||
if [ -z "${linuxParamsByVersion[$version]}" ]
|
||||
then
|
||||
echo "Given version ($version) is unsupported"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$( uname -s )" in
|
||||
Linux)
|
||||
shatool="sha256sum"
|
||||
sha256sum=$(cut -f 1 <<<"${linuxParamsByVersion[$version]}")
|
||||
platform=$(cut -f 2 <<<"${linuxParamsByVersion[$version]}")
|
||||
arch="x86_64"
|
||||
;;
|
||||
Darwin)
|
||||
shatool="shasum -a 256"
|
||||
sha256sum="20dbede1d80c1ac80be2966172f8838c3d899951ac4467372f806b386d42ad3c"
|
||||
platform="macos"
|
||||
arch="universal"
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized platform $( uname -s )"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
readonly shatool
|
||||
readonly sha256sum
|
||||
readonly platform
|
||||
readonly arch
|
||||
|
||||
readonly filename="cmake-$version-$platform-$arch"
|
||||
readonly tarball="$filename.tar.gz"
|
||||
|
||||
cd .gitlab || exit
|
||||
|
||||
echo "$sha256sum $tarball" > cmake.sha256sum
|
||||
curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
|
||||
$shatool --check cmake.sha256sum
|
||||
tar xf "$tarball"
|
||||
mv "$filename" cmake
|
||||
|
||||
if [ "$( uname -s )" = "Darwin" ]; then
|
||||
ln -s CMake.app/Contents/bin cmake/bin
|
||||
fi
|
@ -13,6 +13,7 @@ build:ubuntu1604_gcc5:
|
||||
- .ubuntu1604_cuda
|
||||
- .cmake_build_linux
|
||||
- .only-default
|
||||
- .use_minimum_supported_cmake
|
||||
variables:
|
||||
CC: "gcc-5"
|
||||
CXX: "g++-5"
|
||||
@ -50,6 +51,7 @@ build:ubuntu1604_gcc5_2:
|
||||
- .ubuntu1604_cuda
|
||||
- .cmake_build_linux
|
||||
- .only-master
|
||||
- .use_minimum_supported_cmake
|
||||
variables:
|
||||
CC: "gcc-5"
|
||||
CXX: "g++-5"
|
||||
@ -87,6 +89,7 @@ build:ubuntu1604_clang5:
|
||||
- .ubuntu1604
|
||||
- .cmake_build_linux
|
||||
- .only-default
|
||||
- .use_minimum_supported_cmake
|
||||
variables:
|
||||
CC: "clang-5.0"
|
||||
CXX: "clang++-5.0"
|
||||
|
@ -21,7 +21,10 @@
|
||||
timeout: 2 hours
|
||||
interruptible: true
|
||||
before_script:
|
||||
- Invoke-Expression -Command .gitlab/ci/config/cmake.ps1
|
||||
- Invoke-Expression -Command .gitlab/ci/config/vcvarsall.ps1
|
||||
- $pwdpath = $pwd.Path
|
||||
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
|
||||
- "cmake --version"
|
||||
- "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake"
|
||||
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
|
||||
@ -64,13 +67,12 @@
|
||||
timeout: 50 minutes
|
||||
interruptible: true
|
||||
before_script:
|
||||
- Invoke-Expression -Command .gitlab/ci/config/cmake.ps1
|
||||
- Invoke-Expression -Command .gitlab/ci/config/vcvarsall.ps1
|
||||
- $pwdpath = $pwd.Path
|
||||
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
|
||||
script:
|
||||
#Need to use our custom ctest-latest symlink
|
||||
#This will allow us to use 3.17+ which has support
|
||||
#for running failed tests multiple times so failures
|
||||
#due to system load are not reported
|
||||
- "ctest-latest -VV -S .gitlab/ci/ctest_test.cmake"
|
||||
- "ctest -VV -S .gitlab/ci/ctest_test.cmake"
|
||||
|
||||
# Build on windows10 with Visual Studio
|
||||
# Will have CUDA 10.2 once build issues are resolved
|
||||
|
@ -15,6 +15,8 @@
|
||||
## cmake -DVTKm_SOURCE_DIR=<VTKm_SOURCE_DIR> -P <VTKm_SOURCE_DIR>/CMake/VTKMCheckCopyright.cmake
|
||||
##
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
set(FILES_TO_CHECK
|
||||
*.txt
|
||||
*.cmake
|
||||
|
@ -56,3 +56,4 @@ vtkm/cont/tbb/internal/kxsort.h
|
||||
vtkm/thirdparty
|
||||
vtkm/internal/brigand.hpp
|
||||
version.txt
|
||||
.gitlab/cmake
|
||||
|
Loading…
Reference in New Issue
Block a user