summaryrefslogtreecommitdiffstats
path: root/.gitlab/os-windows.yml
blob: cd2f1682c6db8d82428e66b9d695c55181d8db98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Windows-specific builder configurations and build commands

## Base configurations

.windows:
    variables:
        GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci ext\\$CI_CONCURRENT_ID"
        # Avoid conflicting with other projects running on the same machine.
        SCCACHE_SERVER_PORT: 4227

### 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\\cmake ci"

.windows_ninja:
    extends: .windows_build

    variables:
        # Debug and RelWithDebinfo build types use the `/Zi` which results in
        # uncacheable compiations.
        # https://github.com/mozilla/sccache/issues/242
        CMAKE_BUILD_TYPE: Release
        CTEST_NO_WARNINGS_ALLOWED: 1

.windows_vs2019_x64_ninja:
    extends: .windows_ninja

    variables:
        CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
        VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
        VCVARSPLATFORM: "x64"
        VCVARSVERSION: "14.28.29910"

### External testing

.windows_vs2019_x64:
    extends: .windows

    variables:
        CMAKE_CONFIGURATION: windows_vs2019_x64
        CMAKE_GENERATOR: "Visual Studio 16 2019"
        CMAKE_GENERATOR_PLATFORM: "x64"
        CMAKE_GENERATOR_TOOLSET: "v142,version=14.28.29910"
        CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"

## Tags

.windows_builder_tags:
    tags:
        - cmake # Since this is a bare runner, pin to a project.
        - windows
        - shell
        - vs2019
        - msvc-19.28-16.9
        - nonconcurrent

.windows_builder_ext_tags:
    tags:
        - cmake # Since this is a bare runner, pin to a project.
        - windows
        - shell
        - vs2019
        - msvc-19.28-16.9
        - concurrent

## Windows-specific scripts

.before_script_windows: &before_script_windows
    - Invoke-Expression -Command .gitlab/ci/wix.ps1
    - Invoke-Expression -Command .gitlab/ci/cmake.ps1
    - Invoke-Expression -Command .gitlab/ci/ninja.ps1
    - $pwdpath = $pwd.Path
    - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
    - (& "$env:WIX\bin\light.exe" -help) | Select -First 1
    - 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"
    - cmake -P .gitlab/ci/download_python3.cmake
    - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\python3;$env:PATH"
    - python --version

.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

.cmake_test_windows_external:
    stage: test-ext

    script:
        - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake

    interruptible: true