os-windows.yml 3.9 KB
Newer Older
Ben Boeckel's avatar
Ben Boeckel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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\\paraview-ci"
22
23
24
        # 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
Ben Boeckel's avatar
Ben Boeckel committed
25
26
27
28
29
30
31

.windows_vs2019:
    extends: .windows_build

    variables:
        VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
        VCVARSPLATFORM: "x64"
32
        VCVARSVERSION: "14.28"
Ben Boeckel's avatar
Ben Boeckel committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

.windows_vs2019_mpi:
    extends: .windows_vs2019

    variables:
        CMAKE_CONFIGURATION: windows_vs2019_mpi

.windows_vs2019_nompi:
    extends: .windows_vs2019

    variables:
        CMAKE_CONFIGURATION: windows_vs2019_nompi

## Tags

.windows_builder_tags:
    tags:
        - paraview # Since this is a bare runner, pin to a project.
51
        - msvc-19.28
Ben Boeckel's avatar
Ben Boeckel committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
        - 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
    # Support submodule references to the user's fork.
    - git submodule update --init --recursive
68
    - git submodule foreach --recursive cmake -P "$pwdpath/.gitlab/ci/fetch_submodule.cmake"
Ben Boeckel's avatar
Ben Boeckel committed
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
    - git submodule sync --recursive
    - git submodule update --init --recursive

.before_script_windows_deps: &before_script_windows_deps
    - cmake -P .gitlab/ci/download_qt.cmake
    - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH"
    # Add the outputs to the PATH
    - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\build\install\Python;$env:PATH;$pwdpath\build\install\bin"
    - Set-Item -Force -Path "env:PYTHONHOME" -Value "$pwdpath\build\install\Python"

.before_script_windows_paraview: &before_script_windows_paraview
    - .gitlab/ci/checkout_paraview.ps1
    - git -C $env:CI_PROJECT_DIR\source-paraview rev-parse HEAD | Tee-Object -Variable paraview_commit_sha
    - git -C $env:CI_PROJECT_DIR\source-paraview rev-parse --short HEAD | Tee-Object -Variable paraview_commit_short_sha
    - Set-Item -Force -Path "env:PARAVIEW_COMMIT_SHA" -Value "$paraview_commit_sha"
    - Set-Item -Force -Path "env:PARAVIEW_COMMIT_SHORT_SHA" -Value "$paraview_commit_short_sha"

.cmake_build_windows:
    stage: build

    script:
        - *before_script_windows
        - *before_script_windows_deps
        - *before_script_windows_paraview
        - Set-Item -Force -Path "env:GIT_CEILING_DIRECTORIES" -Value "$pwdpath"
        - 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
        - ctest -V --output-on-failure -S .gitlab/ci/ctest_package.cmake
        - sccache --show-stats
        - sccache --stop-server
    interruptible: true

.cmake_test_windows:
    stage: test

    script:
        - *before_script_windows
        - ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
    interruptible: true