os-macos.yml 5.9 KB

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