Merge topic 'ci-provide-cmake'

5353934e6 CI: Add Junit support
4b6175980 CI: download/install cmake in each build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !2537
This commit is contained in:
Vicente Bolea 2021-08-17 20:58:00 +00:00 committed by Kitware Robot
commit 675cdfe959
9 changed files with 120 additions and 11 deletions

@ -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
@ -194,13 +202,18 @@ stages:
- build/*/*/*/*.png
- build/*/*/*/*.pnm
- build/*/*/*/*.pmm
reports:
junit:
- build/junit.xml
.cmake_memcheck_linux: &cmake_memcheck_linux
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
@ -209,6 +222,9 @@ stages:
- build/*.png
- build/*.pnm
- build/*.pmm
reports:
junit:
- build/junit.xml
include:
- local: '/.gitlab/ci/centos7.yml'

@ -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

@ -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

@ -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

@ -10,6 +10,9 @@
##
##=============================================================================
# We need this CMake versions for tests
cmake_minimum_required(VERSION 3.21)
# Read the files from the build directory that contain
# host information ( name, parallel level, etc )
include("$ENV{CI_PROJECT_DIR}/build/CIState.cmake")
@ -33,6 +36,7 @@ ctest_test(APPEND
RETURN_VALUE test_result
EXCLUDE "${test_exclusions}"
REPEAT "UNTIL_PASS:3"
OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml"
)
message(STATUS "ctest_test RETURN_VALUE: ${test_result}")

@ -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"

@ -6,6 +6,11 @@
# Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\vtkm ci"
artifacts:
reports:
junit:
- build/junit.xml
.windows_vs2019:
variables:
@ -21,7 +26,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 +72,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