Merge topic 'cxx-checks-tolerate-unused-arguments'
[kiteware-cmake.git] / .gitlab / os-macos.yml
blob23c68d5d33f57644c35cc16280cae89d5a46e88c
1 # macOS-specific builder configurations and build commands
3 ## Base configurations
5 .macos:
6     variables:
7         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
8         # TODO: Factor this out so that each job selects the Xcode version to
9         # use so that different versions can be tested in a single pipeline.
10         DEVELOPER_DIR: "/Applications/Xcode-15.3.app/Contents/Developer"
11         # Avoid conflicting with other projects running on the same machine.
12         SCCACHE_SERVER_PORT: 4227
14 ### Build and test
16 .macos_build:
17     extends: .macos
19     variables:
20         # Note that shell runners only support runners with a single
21         # concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
22         # change between the build and test stages which CMake doesn't support.
23         # Even if we could, it could change if other runners on the machine
24         # could run at the same time, so we drop it.
25         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
27 .macos_x86_64_ninja:
28     extends: .macos_build
30     variables:
31         CMAKE_CONFIGURATION: macos_x86_64_ninja
32         CTEST_NO_WARNINGS_ALLOWED: 1
34 .macos_arm64_ninja:
35     extends: .macos_build
37     variables:
38         CMAKE_CONFIGURATION: macos_arm64_ninja
39         CTEST_NO_WARNINGS_ALLOWED: 1
41 .macos_arm64_ninja_symlinked:
42     extends: .macos_build
44     variables:
45         CMAKE_CONFIGURATION: macos_arm64_ninja_symlinked
46         CTEST_NO_WARNINGS_ALLOWED: 1
47         CMAKE_CI_IN_SYMLINK_TREE: 1
48         CMAKE_CI_BUILD_DIR: "real_work/work/build"
50 .macos_arm64_pch:
51     extends: .macos_arm64_ninja
53     variables:
54         CMAKE_CONFIGURATION: macos_arm64_pch
56 .macos_x86_64_makefiles:
57     extends: .macos_build
59     variables:
60         CMAKE_CONFIGURATION: macos_x86_64_makefiles
61         CTEST_NO_WARNINGS_ALLOWED: 1
62         CMAKE_GENERATOR: "Unix Makefiles"
64 .macos_package:
65     extends: .macos_build
67     variables:
68         CMAKE_CONFIGURATION: macos_package
69         CTEST_NO_WARNINGS_ALLOWED: 1
70         CMAKE_CI_NO_INSTALL: 1
72 .macos10.10_package:
73     extends: .macos_build
75     variables:
76         CMAKE_CONFIGURATION: macos10.10_package
77         CTEST_NO_WARNINGS_ALLOWED: 1
78         CMAKE_CI_NO_INSTALL: 1
80 ### External testing
82 .macos_x86_64_xcode:
83     extends: .macos
85     variables:
86         CMAKE_CONFIGURATION: macos_x86_64_xcode
87         CMAKE_GENERATOR: Xcode
88         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
90 .macos_arm64_xcode:
91     extends: .macos
93     variables:
94         CMAKE_CONFIGURATION: macos_arm64_xcode
95         CMAKE_GENERATOR: Xcode
96         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
98 .macos_arm64_xcode_symlinked:
99     extends: .macos
101     variables:
102         CMAKE_CONFIGURATION: macos_arm64_xcode_symlinked
103         CMAKE_GENERATOR: Xcode
104         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
105         CMAKE_CI_IN_SYMLINK_TREE: 1
106         CMAKE_CI_BUILD_DIR: "real_work/work/build"
108 .macos_arm64_xcode_ub:
109     extends: .macos
111     variables:
112         CMAKE_CONFIGURATION: macos_arm64_xcode_ub
113         CMAKE_GENERATOR: Xcode
114         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
116 .macos_arm64_ninja_multi:
117     extends: .macos
119     variables:
120         CMAKE_CONFIGURATION: macos_arm64_ninja_multi
121         CMAKE_GENERATOR: "Ninja Multi-Config"
122         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
124 .macos_x86_64_ninja_ub:
125     extends: .macos
127     variables:
128         CMAKE_CONFIGURATION: macos_x86_64_ninja_ub
129         CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
131 ## Tags
133 .macos_x86_64_tags:
134     tags:
135         - cmake # Since this is a bare runner, pin to a project.
136         - macos-x86_64
137         - shell
138         - xcode-15.3
139         - nonconcurrent
141 .macos_x86_64_tags_ext:
142     tags:
143         - cmake # Since this is a bare runner, pin to a project.
144         - macos-x86_64
145         - shell
146         - xcode-15.3
147         - concurrent
149 .macos_arm64_tags:
150     tags:
151         - cmake # Since this is a bare runner, pin to a project.
152         - macos-arm64
153         - shell
154         - xcode-15.3
155         - nonconcurrent
157 .macos_arm64_tags_ext:
158     tags:
159         - cmake # Since this is a bare runner, pin to a project.
160         - macos-arm64
161         - shell
162         - xcode-15.3
163         - concurrent
165 .macos_arm64_tags_package:
166     tags:
167         - cmake # Since this is a bare runner, pin to a project.
168         - macos-arm64
169         - shell
170         - xcode-15.3
171         - nonconcurrent
172         - finder
174 ## macOS-specific scripts
176 .before_script_macos: &before_script_macos
177     - source .gitlab/ci/env.sh
178     - .gitlab/ci/cmake.sh
179     - export PATH=$PWD/.gitlab/cmake/bin:$PATH
180     - .gitlab/ci/ninja.sh
181     - export PATH=$PWD/.gitlab:$PATH
182     - cmake --version
183     - ninja --version
184     # Download Qt
185     - cmake -P .gitlab/ci/download_qt.cmake
186     - export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
188 .cmake_build_macos:
189     stage: build
191     script:
192         - *before_script_macos
193         - .gitlab/ci/sccache.sh
194         # Allow the server to already be running.
195         - "sccache --start-server || :"
196         - sccache --show-stats
197         - .gitlab/ci/pre_build.sh
198         - ctest -VV -S .gitlab/ci/ctest_configure.cmake
199         - ctest -VV -S .gitlab/ci/ctest_build.cmake
200         - .gitlab/ci/post_build.sh
201         - sccache --show-stats
203     interruptible: true
205 .cmake_test_macos:
206     stage: test
208     script:
209         - *before_script_macos
210         - ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
212     interruptible: true
214 .cmake_test_macos_external:
215     stage: test-ext
217     script:
218         - *before_script_macos
219         - .gitlab/ci/sccache.sh
220         # Allow the server to already be running.
221         - "sccache --start-server || :"
222         - sccache --show-stats
223         - "$LAUNCHER build/install/CMake.app/Contents/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake"
224         - sccache --show-stats
226     interruptible: true