-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
os-macos.yml
274 lines (219 loc) · 7.83 KB
/
os-macos.yml
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# macOS-specific builder configurations and build commands
## Base configurations
.macos:
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/vtk-ci-ext/$CI_CONCURRENT_ID"
# TODO: Factor this out so that each job selects the Xcode version to
# use so that different versions can be tested in a single pipeline.
DEVELOPER_DIR: "/Applications/Xcode-14.2.app/Contents/Developer"
.wheel_macos_arm64:
extends: .macos
variables:
VTK_INSTALL: 1
.wheel_macos39_arm64:
extends: .wheel_macos_arm64
variables:
CMAKE_CONFIGURATION: wheel_macos39_arm64
PYTHON_VERSION_SUFFIX: "3.9"
_PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
.wheel_macos310_arm64:
extends: .wheel_macos_arm64
variables:
CMAKE_CONFIGURATION: wheel_macos310_arm64
PYTHON_VERSION_SUFFIX: "3.10"
_PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
.wheel_macos311_arm64:
extends: .wheel_macos_arm64
variables:
CMAKE_CONFIGURATION: wheel_macos311_arm64
PYTHON_VERSION_SUFFIX: "3.11"
_PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
.wheel_macos_x86_64:
extends: .macos
variables:
VTK_INSTALL: 1
.wheel_macos36_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos36_x86_64
PYTHON_VERSION_SUFFIX: "3.6"
.wheel_macos37_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos37_x86_64
PYTHON_VERSION_SUFFIX: "3.7"
.wheel_macos38_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos38_x86_64
PYTHON_VERSION_SUFFIX: "3.8"
.wheel_macos39_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos39_x86_64
PYTHON_VERSION_SUFFIX: "3.9"
.wheel_macos310_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos310_x86_64
PYTHON_VERSION_SUFFIX: "3.10"
_PYTHON_HOST_PLATFORM: "macosx-10.10-x86_64"
.wheel_macos311_x86_64:
extends: .wheel_macos_x86_64
variables:
CMAKE_CONFIGURATION: wheel_macos311_x86_64
PYTHON_VERSION_SUFFIX: "3.11"
_PYTHON_HOST_PLATFORM: "macosx-10.10-x86_64"
### Build and test
.macos_build:
extends: .macos
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/vtk-ci"
.macos_arm64_kits_python_qt:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_arm64_kits_python_qt
VTK_INSTALL: 1
.macos_x86_64_kits_python_qt:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_x86_64_kits_python_qt
VTK_INSTALL: 1
.macos_x86_64_kits_python_qt_stdthread:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_x86_64_kits_python_qt_stdthread
.macos_x86_64_kits_python_qt_ext_vtk:
extends: .macos
variables:
CMAKE_CONFIGURATION: macos_x86_64_kits_python_qt_ext_vtk
## Tags
.macos_builder_tags:
tags:
- vtk
- macos-x86_64
- shell
- xcode-14.2
- nonconcurrent
.macos_wheel_builder_tags:
tags:
- vtk
- macos-x86_64
- shell
- xcode-14.2
- concurrent
.macos_ext_builder_tags:
tags:
- vtk
- macos-x86_64
- shell
- xcode-14.2
- concurrent
.macos_arm64_builder_tags:
tags:
- vtk
- macos-arm64
- shell
- xcode-14.2
- nonconcurrent
.macos_arm64_wheel_builder_tags:
tags:
- vtk
- macos-arm64
- shell
- xcode-14.2
- concurrent
## macOS-specific scripts
.before_script_macos: &before_script_macos
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt
- "git submodule update --init --recursive || :"
- git submodule foreach --recursive cmake -P "$PWD/.gitlab/ci/fetch_submodule.cmake"
- git submodule sync --recursive
- git submodule update --init --recursive
.cmake_build_macos:
stage: build
extends: .warning_policy
script:
- *before_script_macos
- .gitlab/ci/sccache.sh
# Allow the server to already be running.
- "sccache --start-server || :"
- sccache --show-stats
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake &> $GIT_CLONE_PATH/compile_output.log
- sccache --show-stats
- exec .gitlab/ci/check_warnings.sh .
interruptible: true
.cmake_test_macos:
stage: test
script:
- *before_script_macos
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
interruptible: true
.cmake_test_external_macos:
stage: test-ext
extends: .warning_policy
script:
- *before_script_macos
- ctest -V --output-on-failure -S .gitlab/ci/ctest_test_external.cmake
- exec .gitlab/ci/check_warnings.sh ./Testing/External
interruptible: true
.cmake_build_wheel_macos:
stage: build
extends: .warning_policy
script:
- *before_script_macos
- .gitlab/ci/sccache.sh
- cmake -P .gitlab/ci/download_wheel_python.cmake
- export PYTHON_PREFIX=$GIT_CLONE_PATH/.gitlab/python/Python.framework/Versions/Current
# Allow the server to already be running.
- "sccache --start-server || :"
- sccache --show-stats
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake &> $GIT_CLONE_PATH/compile_output.log
- sccache --show-stats
- cd build
- "$PYTHON_PREFIX/bin/python$PYTHON_VERSION_SUFFIX -m venv venv"
- venv/bin/pip install wheel
- venv/bin/python3 setup.py bdist_wheel
- '[ -f dist/*_universal2.whl ] && exit 1 # universal2 wheels are not made; platform detection requires an override'
- venv/bin/python3 $GIT_CLONE_PATH/.gitlab/ci/create_wheel_sdk_archive.py
# XXX: `delocate` can't handle `@loader_path` or do recursive
# dependency scanning. Ignore it and just do it manually because
# apparently VTK is the most complicated wheel in the world.
# - venv/bin/pip install delocate
# - venv/bin/delocate-listdeps dist/*.whl > $GIT_CLONE_PATH/wheel_output.log
# - venv/bin/delocate-wheel -v dist/*.whl >> $GIT_CLONE_PATH/wheel_output.log
- cd ..
- exec .gitlab/ci/check_warnings.sh .
interruptible: true
.cmake_test_wheel_macos:
stage: test
script:
- *before_script_macos
- cmake -P .gitlab/ci/download_wheel_python.cmake
- export PYTHON_PREFIX=$GIT_CLONE_PATH/.gitlab/python/Python.framework/Versions/Current
- "$PYTHON_PREFIX/bin/python$PYTHON_VERSION_SUFFIX -m venv venv"
- . venv/bin/activate
# Needed to rebuild some dependencies which don't have arm64-compatible wheels yet.
- '[ "$( uname -m )" = "arm64" ] && pip install wheel'
- pip install twine
- twine check build/dist/*.whl
- pip install build/dist/*.whl
- python -c "import vtk"
- if [ "$VTK_DISABLE_PYI_TESTING" != "1" ]; then python -m vtkmodules.generate_pyi --test -p vtkmodules; else echo "pyi test is disabled."; fi
- ctest -V --output-on-failure -S .gitlab/ci/ctest_test_external_wheel.cmake
- exec .gitlab/ci/check_warnings.sh ./Testing/ExternalWheel
interruptible: true