Commit e6dbbfa2 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

gitlab-ci: add Windows jobs

parent 329866a4
......@@ -6,6 +6,7 @@ include:
# OS builds.
- local: .gitlab/os-linux.yml
- local: .gitlab/os-macos.yml
- local: .gitlab/os-windows.yml
stages:
- build
......@@ -151,3 +152,26 @@ test:macos:
- build:macos
needs:
- build:macos
# 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")
# Windows-specific builder configurations and build commands
## Base configurations
.windows:
variables:
GIT_SUBMODULE_STRATEGY: none
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"
.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
after_script:
# Ensure that `git clean` can always remove the directory. But don't
# remove so much that the build cannot be debugged.
# https://github.com/git-for-windows/git/issues/2715
- cmd /C "rmdir /S /Q build\superbuild\smtk\build\PluginTests"
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