os-macos.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. # macOS-specific builder configurations and build commands
  2. ## Base configurations
  3. .macos:
  4. variables:
  5. GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
  6. # TODO: Factor this out so that each job selects the Xcode version to
  7. # use so that different versions can be tested in a single pipeline.
  8. DEVELOPER_DIR: "/Applications/Xcode-26.2.app/Contents/Developer"
  9. ### Build and test
  10. .macos_build:
  11. extends: .macos
  12. variables:
  13. # Note that shell runners only support runners with a single
  14. # concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
  15. # change between the build and test stages which CMake doesn't support.
  16. # Even if we could, it could change if other runners on the machine
  17. # could run at the same time, so we drop it.
  18. GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
  19. .macos_x86_64_ninja:
  20. extends: .macos_build
  21. variables:
  22. CMAKE_CONFIGURATION: macos_x86_64_ninja
  23. CMAKE_CI_BUILD_TYPE: Release
  24. CTEST_NO_WARNINGS_ALLOWED: 1
  25. .macos_arm64_ninja:
  26. extends: .macos_build
  27. variables:
  28. CMAKE_CONFIGURATION: macos_arm64_ninja
  29. CMAKE_CI_BUILD_TYPE: Release
  30. CTEST_NO_WARNINGS_ALLOWED: 1
  31. .macos_arm64_ninja_symlinked:
  32. extends: .macos_build
  33. variables:
  34. CMAKE_CONFIGURATION: macos_arm64_ninja_symlinked
  35. CTEST_NO_WARNINGS_ALLOWED: 1
  36. CMAKE_CI_IN_SYMLINK_TREE: 1
  37. CMAKE_CI_BUILD_DIR: "real_work/work/build"
  38. .macos_arm64_pch:
  39. extends: .macos_arm64_ninja
  40. variables:
  41. CMAKE_CONFIGURATION: macos_arm64_pch
  42. .macos_x86_64_makefiles:
  43. extends: .macos_build
  44. variables:
  45. CMAKE_CONFIGURATION: macos_x86_64_makefiles
  46. CTEST_NO_WARNINGS_ALLOWED: 1
  47. CMAKE_GENERATOR: "Unix Makefiles"
  48. .macos_package:
  49. extends: .macos_build
  50. variables:
  51. CMAKE_CONFIGURATION: macos_package
  52. CTEST_NO_WARNINGS_ALLOWED: 1
  53. CMAKE_CI_NO_INSTALL: 1
  54. .macos10.10_package:
  55. extends: .macos_build
  56. variables:
  57. CMAKE_CONFIGURATION: macos10.10_package
  58. CTEST_NO_WARNINGS_ALLOWED: 1
  59. CMAKE_CI_NO_INSTALL: 1
  60. ### External testing
  61. .macos_x86_64_xcode:
  62. extends: .macos
  63. variables:
  64. CMAKE_CONFIGURATION: macos_x86_64_xcode
  65. CMAKE_GENERATOR: Xcode
  66. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  67. .macos_arm64_xcode:
  68. extends: .macos
  69. variables:
  70. CMAKE_CONFIGURATION: macos_arm64_xcode
  71. CMAKE_GENERATOR: Xcode
  72. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  73. .macos_arm64_xcode_symlinked:
  74. extends: .macos
  75. variables:
  76. CMAKE_CONFIGURATION: macos_arm64_xcode_symlinked
  77. CMAKE_GENERATOR: Xcode
  78. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  79. CMAKE_CI_IN_SYMLINK_TREE: 1
  80. CMAKE_CI_BUILD_DIR: "real_work/work/build"
  81. .macos_arm64_xcode_ub:
  82. extends: .macos
  83. variables:
  84. CMAKE_CONFIGURATION: macos_arm64_xcode_ub
  85. CMAKE_GENERATOR: Xcode
  86. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  87. .macos_arm64_ninja_multi:
  88. extends: .macos
  89. variables:
  90. CMAKE_CONFIGURATION: macos_arm64_ninja_multi
  91. CMAKE_GENERATOR: "Ninja Multi-Config"
  92. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  93. .macos_x86_64_ninja_ub:
  94. extends: .macos
  95. variables:
  96. CMAKE_CONFIGURATION: macos_x86_64_ninja_ub
  97. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  98. .macos_arm64_fastbuild:
  99. extends: .macos
  100. variables:
  101. CMAKE_CONFIGURATION: macos_arm64_fastbuild
  102. CMAKE_GENERATOR: FASTBuild
  103. CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
  104. ## Tags
  105. .macos_x86_64_tags:
  106. tags:
  107. - cmake # Since this is a bare runner, pin to a project.
  108. - macos-x86_64
  109. - shell
  110. - xcode-26.2
  111. - nonconcurrent
  112. .macos_x86_64_tags_ext:
  113. tags:
  114. - cmake # Since this is a bare runner, pin to a project.
  115. - macos-x86_64
  116. - shell
  117. - xcode-26.2
  118. - concurrent
  119. .macos_arm64_tags:
  120. tags:
  121. - cmake # Since this is a bare runner, pin to a project.
  122. - macos-arm64
  123. - shell
  124. - xcode-26.2
  125. - nonconcurrent
  126. .macos_arm64_tags_ext:
  127. tags:
  128. - cmake # Since this is a bare runner, pin to a project.
  129. - macos-arm64
  130. - shell
  131. - xcode-26.2
  132. - concurrent
  133. .macos_arm64_tags_package:
  134. tags:
  135. - cmake # Since this is a bare runner, pin to a project.
  136. - macos-arm64
  137. - shell
  138. - xcode-26.2
  139. - nonconcurrent
  140. - finder
  141. ## macOS-specific scripts
  142. .before_script_macos: &before_script_macos
  143. - source .gitlab/ci/env.sh
  144. - source .gitlab/ci/cmake-env.sh
  145. - source .gitlab/ci/ninja-env.sh
  146. # Download Qt
  147. - cmake -P .gitlab/ci/download_qt.cmake
  148. - export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}
  149. .cmake_build_macos:
  150. stage: build
  151. script:
  152. - *before_script_macos
  153. - .gitlab/ci/sccache.sh
  154. # Allow the server to already be running.
  155. - "sccache --start-server || :"
  156. - sccache --show-stats
  157. - .gitlab/ci/pre_configure.sh
  158. - ctest -VV -S .gitlab/ci/ctest_configure.cmake
  159. - .gitlab/ci/pre_build.sh
  160. - ctest -VV -S .gitlab/ci/ctest_build.cmake
  161. - .gitlab/ci/post_build.sh
  162. - sccache --show-stats
  163. interruptible: true
  164. .cmake_test_macos:
  165. stage: test
  166. script:
  167. - *before_script_macos
  168. - .gitlab/ci/pre_test.sh
  169. - ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
  170. interruptible: true
  171. .cmake_test_macos_external:
  172. stage: test-ext
  173. script:
  174. - *before_script_macos
  175. - .gitlab/ci/sccache.sh
  176. # Allow the server to already be running.
  177. - "sccache --start-server || :"
  178. - sccache --show-stats
  179. - "$LAUNCHER build/install/CMake.app/Contents/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake"
  180. - sccache --show-stats
  181. interruptible: true