Commit c2ae5d5a authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'ci-windows'

fb28908a gitlab-ci: add a Windows build
a1782c10 ci: add support for Windows to CI scripts
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: David Thompson's avatarDavid Thompson <david.thompson@kitware.com>
Merge-request: !762
parents 95b597d9 fb28908a
Pipeline #194422 passed with stages
......@@ -6,6 +6,7 @@ include:
# OS builds.
- local: .gitlab/os-linux.yml
- local: .gitlab/os-macos.yml
- local: .gitlab/os-windows.yml
stages:
- build
......@@ -152,3 +153,26 @@ test:macos-plain:
- build:macos-plain
needs:
- build:macos-plain
# Windows
## Build and test
build:windows-vs2019-ninja:
extends:
- .windows_vs2019_ninja
- .cmake_build_windows
- .cmake_build_artifacts
- .windows_builder_tags
- .run_automatically
test:windows-vs2019-ninja:
extends:
- .windows_vs2019_ninja
- .cmake_test_windows
- .windows_builder_tags
- .run_automatically
dependencies:
- build:windows-vs2019-ninja
needs:
- build:windows-vs2019-ninja
$erroractionpreference = "stop"
$version = "3.17.3"
$sha256sum = "8A02DE221AA96C236A947B28CA1BD6327B9BB82FA74B91E5CAA49FFD6A642AE2"
$filename = "cmake-$version-win64-x64"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
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"
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows.cmake")
......@@ -8,7 +8,11 @@ cmake_minimum_required(VERSION 3.12)
set(data_host "https://data.kitware.com")
# Determine the tarball to download.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2019")
# 20201001
set(file_item "5f75d22350a41e3d19beed33")
set(file_hash "a555ef360539ba7c8fd838b9c94e670a26b292bcad16417423ae5cfe54ac8efaf9be2995ef3775ebdc6007c56568a5c539d6c5acaf2d6ff50d8d496b6af7ee81")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
# 20200912
set(file_item "5f74716e50a41e3d19bb5ef4")
set(file_hash "26832c678d2c41f247005c0d56736933cbf12a3fed8db9449def49dbce598c8f332f070c2932ceeefeface273e32a4b323a578408fe13c9a64361a14e96d0101")
......
$erroractionpreference = "stop"
$version = "1.10.0"
$sha256sum = "919FD158C16BF135E8A850BB4046EC1CE28A7439EE08B977CD0B7F6B3463D178"
$filename = "ninja-win"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/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")
$erroractionpreference = "stop"
cmd /c "`"$env:VCVARSALL`" $VCVARSPLATFORM -vcvars_ver=$VCVARSVERSION & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("=")
[Environment]::SetEnvironmentVariable($v[0], $v[1])
}
}
# Windows-specific builder configurations and build commands
## Base configurations
.windows:
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmb-ci-ext\\$CI_CONCURRENT_ID"
### Build and test
.windows_build:
extends: .windows
variables:
# Note that shell runners only support runners with a single
# concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
# 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
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmb-ci"
# Force "desktop" OpenGL support. Qt seems to want to use EGL when run
# from GitLab-CI by default (it runs as a Windows service).
QT_OPENGL: desktop
.windows_vs2019:
extends: .windows_build
variables:
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x64"
VCVARSVERSION: "14.26"
.windows_vs2019_ninja:
extends: .windows_vs2019
variables:
CMAKE_CONFIGURATION: windows_vs2019_ninja
## Tags
.windows_builder_tags:
tags:
- cmb # Since this is a bare runner, pin to a project.
- msvc-19.26
- nonconcurrent
- shell
- vs2019
- windows
## Windows-specific scripts
.before_script_windows: &before_script_windows
- Invoke-Expression -Command .gitlab/ci/cmake.ps1
- Invoke-Expression -Command .gitlab/ci/ninja.ps1
- $pwdpath = $pwd.Path
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
- cmake --version
- ninja --version
- cmake -P .gitlab/ci/download_qt.cmake
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH"
# Add the superbuild to the PATH
- cmake -P .gitlab/ci/download_superbuild.cmake
- Set-Item -Force -Path "env:CMAKE_PREFIX_PATH" -Value "$pwdpath\build\install"
- Set-Item -Force -Path "env:SUPERBUILD_PREFIX" -Value "$pwdpath\build"
- Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$pwdpath\build\install\bin;$pwdpath\build\install\Python"
- Set-Item -Force -Path "env:PYTHONHOME" -Value "$pwdpath\build\install\Python"
.cmake_build_windows:
stage: build
script:
- *before_script_windows
- Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- sccache --show-stats
- sccache --stop-server
interruptible: true
.cmake_test_windows:
stage: test
script:
- *before_script_windows
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
interruptible: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment