cmake_install.yml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. name: CMake Install Tests
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches: [ main ]
  6. pull_request:
  7. branches: [ main ]
  8. permissions:
  9. contents: read
  10. jobs:
  11. windows_2022_vcpkg_submodule:
  12. name: Windows 2022 vcpkg submodule versions cxx17 (static libs - dll)
  13. runs-on: windows-2022
  14. env:
  15. # Set to the latest version of cmake 3.x
  16. CMAKE_VERSION: '3.31.6'
  17. # cxx17 is the default for windows-2022
  18. CXX_STANDARD: '17'
  19. steps:
  20. - name: Harden the runner (Audit all outbound calls)
  21. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  22. with:
  23. egress-policy: audit
  24. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  25. with:
  26. submodules: 'recursive'
  27. - name: Build dependencies with vcpkg submodule
  28. run: |
  29. ./ci/setup_cmake.ps1
  30. ./ci/setup_windows_ci_environment.ps1
  31. - name: Run Tests
  32. run: ./ci/do_ci.ps1 cmake.install.test
  33. - name: Run DLL Tests
  34. run: ./ci/do_ci.ps1 cmake.dll.install.test
  35. windows_2019_vcpkg_submodule_min_cmake:
  36. name: Windows 2019 vcpkg submodule versions minimum cmake cxx14 (static libs)
  37. runs-on: windows-2019
  38. env:
  39. # cmake 3.15 is the minimum for windows builds (See https://github.com/open-telemetry/opentelemetry-cpp/pull/3349#discussion_r2030319430)
  40. CMAKE_VERSION: '3.15.0'
  41. # cxx14 is the default for windows-2019
  42. CXX_STANDARD: '14'
  43. steps:
  44. - name: Harden the runner (Audit all outbound calls)
  45. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  46. with:
  47. egress-policy: audit
  48. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  49. with:
  50. submodules: 'recursive'
  51. - name: Build dependencies with vcpkg submodule
  52. run: |
  53. ./ci/setup_cmake.ps1
  54. ./ci/setup_windows_ci_environment.ps1
  55. - name: Run Tests
  56. run: ./ci/do_ci.ps1 cmake.install.test
  57. ubuntu_2404_system_packages:
  58. name: Ubuntu 24.04 apt packages cxx17 (static libs - shared libs)
  59. runs-on: ubuntu-24.04
  60. env:
  61. INSTALL_TEST_DIR: '/home/runner/install_test'
  62. # CMake 3.28 is apt package version for Ubuntu 24.04
  63. CMAKE_VERSION: '3.28.3'
  64. # cxx17 is the default for Ubuntu 24.04
  65. CXX_STANDARD: '17'
  66. BUILD_TYPE: 'Debug'
  67. steps:
  68. - name: Harden the runner (Audit all outbound calls)
  69. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  70. with:
  71. egress-policy: audit
  72. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  73. with:
  74. submodules: 'recursive'
  75. - name: Install libcurl, zlib, nlohmann-json with apt
  76. run: |
  77. sudo -E ./ci/setup_ci_environment.sh
  78. sudo -E ./ci/setup_cmake.sh
  79. sudo -E ./ci/setup_googletest.sh
  80. - name: Install abseil, protobuf, and grpc with apt
  81. run: |
  82. sudo -E apt-get update
  83. sudo -E apt-get install -y libabsl-dev libprotobuf-dev libgrpc++-dev protobuf-compiler protobuf-compiler-grpc
  84. - name: Run Tests (static libs)
  85. env:
  86. BUILD_SHARED_LIBS: 'OFF'
  87. run: ./ci/do_ci.sh cmake.install.test
  88. - name: Run Tests (shared libs)
  89. env:
  90. BUILD_SHARED_LIBS: 'ON'
  91. run: ./ci/do_ci.sh cmake.install.test
  92. ubuntu_2404_latest:
  93. name: Ubuntu 24.04 latest versions cxx20 (static libs)
  94. runs-on: ubuntu-24.04
  95. env:
  96. INSTALL_TEST_DIR: '/home/runner/install_test'
  97. # Set to the latest version of cmake 3.x
  98. CMAKE_VERSION: '3.31.6'
  99. # Set to the latest cxx standard supported by opentelemetry-cpp
  100. CXX_STANDARD: '20'
  101. # Versions below set to the latest version available
  102. # The abseil and protobuf versions are taken from
  103. # the grpc submodules at the GRPC_VERSION tag
  104. GOOGLETEST_VERSION: '1.16.0'
  105. ABSEIL_CPP_VERSION: '20240722.1'
  106. PROTOBUF_VERSION: '29.0'
  107. GRPC_VERSION: 'v1.71.0'
  108. BUILD_TYPE: 'Debug'
  109. steps:
  110. - name: Harden the runner (Audit all outbound calls)
  111. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  112. with:
  113. egress-policy: audit
  114. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  115. with:
  116. submodules: 'recursive'
  117. - name: Install gtest, libcurl, zlib, nlohmann-json with apt
  118. run: |
  119. sudo -E ./ci/setup_ci_environment.sh
  120. sudo -E ./ci/setup_cmake.sh
  121. sudo -E ./ci/setup_googletest.sh
  122. - name: Build abseil, protobuf, and grpc with ci scripts
  123. run: |
  124. sudo -E ./ci/install_abseil.sh
  125. sudo -E ./ci/install_protobuf.sh
  126. sudo -E ./ci/setup_grpc.sh -r $GRPC_VERSION -s $CXX_STANDARD -p protobuf -p abseil-cpp
  127. - name: Run Tests (static libs)
  128. env:
  129. BUILD_SHARED_LIBS: 'OFF'
  130. run: ./ci/do_ci.sh cmake.install.test
  131. ubuntu_2204_stable:
  132. name: Ubuntu 22.04 stable versions cxx17 (static libs - shared libs)
  133. runs-on: ubuntu-22.04
  134. env:
  135. INSTALL_TEST_DIR: '/home/runner/install_test'
  136. # CMake 3.22 is the apt package version for Ubuntu 22.04
  137. CMAKE_VERSION: '3.22.0'
  138. CXX_STANDARD: '17'
  139. # These are stable versions tested in the main ci workflow
  140. # and defaults in the devcontainer
  141. GOOGLETEST_VERSION: '1.14.0'
  142. ABSEIL_CPP_VERSION: '20230125.3'
  143. PROTOBUF_VERSION: '23.3'
  144. GRPC_VERSION: 'v1.55.0'
  145. BUILD_TYPE: 'Debug'
  146. steps:
  147. - name: Harden the runner (Audit all outbound calls)
  148. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  149. with:
  150. egress-policy: audit
  151. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  152. with:
  153. submodules: 'recursive'
  154. - name: Install gtest, libcurl, zlib, nlohmann-json with apt
  155. run: |
  156. sudo -E ./ci/setup_ci_environment.sh
  157. sudo -E ./ci/setup_cmake.sh
  158. sudo -E ./ci/setup_googletest.sh
  159. - name: Build abseil, protobuf, and grpc with ci scripts
  160. run: |
  161. sudo -E ./ci/install_abseil.sh
  162. sudo -E ./ci/install_protobuf.sh
  163. sudo -E ./ci/setup_grpc.sh -r $GRPC_VERSION -s $CXX_STANDARD -p protobuf -p abseil-cpp
  164. - name: Run Tests (static libs)
  165. env:
  166. BUILD_SHARED_LIBS: 'OFF'
  167. run: ./ci/do_ci.sh cmake.install.test
  168. - name: Run Tests (shared libs)
  169. env:
  170. BUILD_SHARED_LIBS: 'ON'
  171. run: ./ci/do_ci.sh cmake.install.test
  172. ubuntu_2204_minimum:
  173. name: Ubuntu 22.04 minimum versions cxx14 (static libs - shared libs)
  174. runs-on: ubuntu-22.04
  175. env:
  176. INSTALL_TEST_DIR: '/home/runner/install_test'
  177. # Set to the current minimum version of cmake
  178. CMAKE_VERSION: '3.14.0'
  179. # cxx14 is the default for Ubuntu 22.04
  180. CXX_STANDARD: '14'
  181. # This is the apt package version of googletest for Ubuntu 22.04
  182. GOOGLETEST_VERSION: '1.11.0'
  183. # These are minimum versions tested in the main ci workflow
  184. ABSEIL_CPP_VERSION: '20220623.2'
  185. PROTOBUF_VERSION: '21.12'
  186. GRPC_VERSION: 'v1.49.2'
  187. BUILD_TYPE: 'Debug'
  188. steps:
  189. - name: Harden the runner (Audit all outbound calls)
  190. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  191. with:
  192. egress-policy: audit
  193. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  194. with:
  195. submodules: 'recursive'
  196. - name: Install gtest, libcurl, zlib, nlohmann-json with apt
  197. run: |
  198. sudo -E ./ci/setup_ci_environment.sh
  199. sudo -E ./ci/setup_cmake.sh
  200. sudo -E ./ci/setup_googletest.sh
  201. - name: Build abseil, protobuf, and grpc with ci scripts
  202. run: |
  203. sudo -E ./ci/install_abseil.sh
  204. sudo -E ./ci/install_protobuf.sh
  205. sudo -E ./ci/setup_grpc.sh -r $GRPC_VERSION -s $CXX_STANDARD -p protobuf -p abseil-cpp
  206. - name: Run Tests (static libs)
  207. env:
  208. BUILD_SHARED_LIBS: 'OFF'
  209. run: ./ci/do_ci.sh cmake.install.test
  210. - name: Run Tests (shared libs)
  211. env:
  212. BUILD_SHARED_LIBS: 'ON'
  213. run: ./ci/do_ci.sh cmake.install.test
  214. ubuntu_2404_conan_stable:
  215. name: Ubuntu 24.04 conan stable versions cxx17 (static libs - shared libs - opentracing shim)
  216. runs-on: ubuntu-24.04
  217. env:
  218. INSTALL_TEST_DIR: '/home/runner/install_test'
  219. # CMake 3.28 is apt package version for Ubuntu 24.04
  220. CMAKE_VERSION: '3.28.3'
  221. CXX_STANDARD: '17'
  222. CMAKE_TOOLCHAIN_FILE: /home/runner/conan/build/Debug/generators/conan_toolchain.cmake
  223. BUILD_TYPE: 'Debug'
  224. steps:
  225. - name: Harden the runner (Audit all outbound calls)
  226. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  227. with:
  228. egress-policy: audit
  229. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  230. with:
  231. submodules: 'recursive'
  232. - name: Install Conan
  233. run: |
  234. python3 -m pip install pip==25.0.1
  235. pip install "conan==2.15.1"
  236. conan profile detect --force
  237. - name: Install or build all dependencies with Conan
  238. run: |
  239. sudo -E ./ci/setup_cmake.sh
  240. conan install install/conan/conanfile_stable.txt --build=missing -of /home/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
  241. - name: Run Tests (static libs)
  242. env:
  243. BUILD_SHARED_LIBS: 'OFF'
  244. run: ./ci/do_ci.sh cmake.install.test
  245. - name: Run Tests (shared libs)
  246. env:
  247. BUILD_SHARED_LIBS: 'ON'
  248. run: ./ci/do_ci.sh cmake.install.test
  249. - name: verify pkgconfig packages
  250. run: |
  251. export PKG_CONFIG_PATH=$INSTALL_TEST_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
  252. ./ci/verify_packages.sh
  253. - name: Run OpenTracing Shim Test
  254. run: ./ci/do_ci.sh cmake.opentracing_shim.install.test
  255. ubuntu_2404_conan_latest:
  256. name: Ubuntu 24.04 conan latest versions cxx17 (static libs)
  257. runs-on: ubuntu-24.04
  258. env:
  259. INSTALL_TEST_DIR: '/home/runner/install_test'
  260. # Set to the latest version of cmake 3.x
  261. CMAKE_VERSION: '3.31.6'
  262. CXX_STANDARD: '17'
  263. CMAKE_TOOLCHAIN_FILE: /home/runner/conan/build/Debug/generators/conan_toolchain.cmake
  264. BUILD_TYPE: 'Debug'
  265. steps:
  266. - name: Harden the runner (Audit all outbound calls)
  267. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  268. with:
  269. egress-policy: audit
  270. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  271. with:
  272. submodules: 'recursive'
  273. - name: Install Conan
  274. run: |
  275. python3 -m pip install pip==25.0.1
  276. pip install "conan==2.15.1"
  277. conan profile detect --force
  278. - name: Install or build all dependencies with Conan
  279. run: |
  280. sudo -E ./ci/setup_cmake.sh
  281. conan install install/conan/conanfile_latest.txt --build=missing -of /home/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
  282. - name: Run Tests (static libs)
  283. env:
  284. BUILD_SHARED_LIBS: 'OFF'
  285. run: ./ci/do_ci.sh cmake.install.test
  286. - name: verify pkgconfig packages
  287. run: |
  288. export PKG_CONFIG_PATH=$INSTALL_TEST_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
  289. ./ci/verify_packages.sh
  290. macos_14_conan_stable:
  291. name: macOS 14 conan stable versions cxx17 (static libs)
  292. runs-on: macos-14
  293. env:
  294. INSTALL_TEST_DIR: '/Users/runner/install_test'
  295. CMAKE_VERSION: '3.28.3'
  296. CXX_STANDARD: '17'
  297. CMAKE_TOOLCHAIN_FILE: '/Users/runner/conan/build/Debug/generators/conan_toolchain.cmake'
  298. BUILD_TYPE: 'Debug'
  299. steps:
  300. - name: Harden the runner (Audit all outbound calls)
  301. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  302. with:
  303. egress-policy: audit
  304. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  305. with:
  306. submodules: 'recursive'
  307. - name: Install Conan and tools
  308. run: |
  309. brew install conan autoconf automake libtool coreutils
  310. ./ci/setup_cmake_macos.sh
  311. conan profile detect --force
  312. - name: Install or build all dependencies with Conan
  313. run: conan install install/conan/conanfile_stable.txt --build=missing -of /Users/runner/conan -s build_type=${BUILD_TYPE} -s compiler.cppstd=${CXX_STANDARD}
  314. - name: Run Tests (static libs)
  315. env:
  316. BUILD_SHARED_LIBS: 'OFF'
  317. run: ./ci/do_ci.sh cmake.install.test
  318. macos_14_brew_packages:
  319. name: macOS 14 brew latest versions cxx17 (static libs)
  320. runs-on: macos-14
  321. env:
  322. INSTALL_TEST_DIR: '/Users/runner/install_test'
  323. # Set to the latest version of cmake 3.x
  324. CMAKE_VERSION: '3.31.6'
  325. CXX_STANDARD: '17'
  326. BUILD_TYPE: 'Debug'
  327. steps:
  328. - name: Harden the runner (Audit all outbound calls)
  329. uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
  330. with:
  331. egress-policy: audit
  332. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  333. with:
  334. submodules: 'recursive'
  335. - name: Install Dependencies with Homebrew
  336. run: |
  337. ./ci/setup_cmake_macos.sh
  338. brew install coreutils
  339. brew install googletest
  340. brew install google-benchmark
  341. brew install zlib
  342. brew install abseil
  343. brew install protobuf
  344. brew install grpc
  345. brew install nlohmann-json
  346. brew install prometheus-cpp
  347. - name: Run Tests (static libs)
  348. env:
  349. BUILD_SHARED_LIBS: 'OFF'
  350. run: ./ci/do_ci.sh cmake.install.test