Commit fb28908a authored by Ben Boeckel's avatar Ben Boeckel

gitlab-ci: add a Windows build

parent a1782c10
Pipeline #192155 passed with stages
in 8 minutes and 40 seconds
......@@ -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
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows.cmake")
......@@ -9,9 +9,9 @@ set(data_host "https://data.kitware.com")
# Determine the tarball to download.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2019")
# 20200930
set(file_item "5f7474dc50a41e3d19bb6127")
set(file_hash "866c286b3ec0c7346fbb4f26a07ea370adcb3ce2b81549af5332449fbcf49dec3661751a5c862ca350d99b0d59892affe67d7c1f22723e728ba23541a2d0de6e")
# 20201001
set(file_item "5f75d22350a41e3d19beed33")
set(file_hash "a555ef360539ba7c8fd838b9c94e670a26b292bcad16417423ae5cfe54ac8efaf9be2995ef3775ebdc6007c56568a5c539d6c5acaf2d6ff50d8d496b6af7ee81")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
# 20200912
set(file_item "5f74716e50a41e3d19bb5ef4")
......
# 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