macos.yml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: macOS
  5. on:
  6. push:
  7. branches:
  8. - master
  9. - '*/ci'
  10. paths-ignore:
  11. - '**/*.md'
  12. - '.azure-pipelines.yml'
  13. - '.circleci/**'
  14. - '.cirrus.yml'
  15. - 'appveyor.yml'
  16. - 'packages/**'
  17. - 'plan9/**'
  18. - 'projects/**'
  19. - 'winbuild/**'
  20. pull_request:
  21. branches:
  22. - master
  23. paths-ignore:
  24. - '**/*.md'
  25. - '.azure-pipelines.yml'
  26. - '.circleci/**'
  27. - '.cirrus.yml'
  28. - 'appveyor.yml'
  29. - 'packages/**'
  30. - 'plan9/**'
  31. - 'projects/**'
  32. - 'winbuild/**'
  33. concurrency:
  34. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  35. cancel-in-progress: true
  36. permissions: {}
  37. env:
  38. DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
  39. MAKEFLAGS: -j 5
  40. jobs:
  41. autotools:
  42. name: ${{ matrix.build.name }}
  43. runs-on: 'macos-latest'
  44. timeout-minutes: 90
  45. strategy:
  46. fail-fast: false
  47. matrix:
  48. build:
  49. - name: normal
  50. install: nghttp2
  51. configure: --without-ssl --enable-websockets
  52. macosx-version-min: 10.9
  53. - name: debug
  54. install: nghttp2
  55. configure: --enable-debug --without-ssl --enable-websockets
  56. macosx-version-min: 10.9
  57. - name: libssh2
  58. install: nghttp2 libssh2
  59. configure: --enable-debug --with-libssh2 --without-ssl --enable-websockets
  60. macosx-version-min: 10.9
  61. - name: libssh-c-ares
  62. install: openssl nghttp2 libssh
  63. configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-ares --enable-websockets
  64. macosx-version-min: 10.9
  65. - name: libssh
  66. install: openssl nghttp2 libssh
  67. configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-websockets
  68. macosx-version-min: 10.9
  69. - name: c-ares
  70. install: nghttp2
  71. configure: --enable-debug --enable-ares --without-ssl --enable-websockets
  72. macosx-version-min: 10.9
  73. - name: HTTP only
  74. install: nghttp2
  75. configure: |
  76. --enable-debug \
  77. --enable-maintainer-mode \
  78. --disable-alt-svc \
  79. --disable-dict \
  80. --disable-file \
  81. --disable-ftp \
  82. --disable-gopher \
  83. --disable-imap \
  84. --disable-ldap \
  85. --disable-pop3 \
  86. --disable-rtmp \
  87. --disable-rtsp \
  88. --disable-scp \
  89. --disable-sftp \
  90. --disable-shared \
  91. --disable-smb \
  92. --disable-smtp \
  93. --disable-telnet \
  94. --disable-tftp \
  95. --disable-unix-sockets \
  96. --without-brotli \
  97. --without-gssapi \
  98. --without-libidn2 \
  99. --without-libpsl \
  100. --without-librtmp \
  101. --without-libssh2 \
  102. --without-nghttp2 \
  103. --without-ntlm-auth \
  104. --without-ssl \
  105. --without-zlib \
  106. --without-zstd
  107. macosx-version-min: 10.15
  108. - name: SecureTransport http2
  109. install: nghttp2
  110. configure: --enable-debug --with-secure-transport --enable-websockets
  111. macosx-version-min: 10.8
  112. - name: gcc SecureTransport
  113. configure: CC=gcc-12 --enable-debug --with-secure-transport --enable-websockets
  114. macosx-version-min: 10.8
  115. - name: OpenSSL http2
  116. install: nghttp2 openssl
  117. configure: --enable-debug --with-openssl=/usr/local/opt/openssl --enable-websockets
  118. macosx-version-min: 10.9
  119. - name: LibreSSL http2
  120. install: nghttp2 libressl
  121. configure: --enable-debug --with-openssl=/usr/local/opt/libressl --enable-websockets
  122. macosx-version-min: 10.9
  123. - name: torture
  124. install: nghttp2 openssl
  125. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl --enable-websockets
  126. tflags: -n -t --shallow=25 !FTP
  127. macosx-version-min: 10.9
  128. - name: torture-ftp
  129. install: nghttp2 openssl
  130. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl --enable-websockets
  131. tflags: -n -t --shallow=20 FTP
  132. macosx-version-min: 10.9
  133. - name: macOS 10.15
  134. install: nghttp2 libssh2 openssl
  135. configure: --enable-debug --disable-ldap --with-openssl=/usr/local/opt/openssl --enable-websockets
  136. macosx-version-min: 10.15
  137. steps:
  138. - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  139. name: 'brew bundle'
  140. # Run this command with retries because of spurious failures seen
  141. # while running the tests, for example
  142. # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
  143. - run: "while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done"
  144. name: 'brew install'
  145. - run: |
  146. case "${{ matrix.build.install }}" in
  147. *openssl*)
  148. ;;
  149. *)
  150. if test -d /usr/local/include/openssl; then
  151. brew unlink openssl
  152. fi;;
  153. esac
  154. name: 'brew unlink openssl'
  155. - run: python3 -m pip install impacket
  156. name: 'pip3 install'
  157. - uses: actions/checkout@v4
  158. - run: autoreconf -fi
  159. name: 'autoreconf'
  160. - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }}
  161. name: 'configure'
  162. env:
  163. CFLAGS: "-mmacosx-version-min=${{ matrix.build.macosx-version-min }}"
  164. - run: make V=1
  165. name: 'make'
  166. - run: make V=1 examples
  167. name: 'make examples'
  168. - run: make V=1 -C tests
  169. name: 'make tests'
  170. - run: make V=1 test-ci
  171. name: 'run tests'
  172. env:
  173. TFLAGS: "${{ matrix.build.tflags }} ~1452"
  174. cmake:
  175. name: cmake ${{ matrix.compiler.CC }} ${{ matrix.build.name }}
  176. runs-on: 'macos-latest'
  177. env: ${{ matrix.compiler }}
  178. strategy:
  179. fail-fast: false
  180. matrix:
  181. compiler:
  182. - CC: clang
  183. CXX: clang++
  184. CFLAGS: "-mmacosx-version-min=10.15 -Wno-deprecated-declarations"
  185. - CC: gcc-12
  186. CXX: g++-12
  187. CFLAGS: "-mmacosx-version-min=10.15 -Wno-error=undef -Wno-error=conversion"
  188. build:
  189. - name: OpenSSL
  190. install: nghttp2 openssl
  191. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
  192. - name: LibreSSL
  193. install: nghttp2 libressl
  194. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_UNITY_BUILD=ON
  195. - name: libssh2
  196. install: nghttp2 openssl libssh2
  197. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_USE_LIBSSH2=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
  198. - name: GnuTLS
  199. install: gnutls
  200. generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_SHARED_LINKER_FLAGS=-L/usr/local/lib -DCMAKE_EXE_LINKER_FLAGS=-L/usr/local/lib
  201. steps:
  202. - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  203. name: 'brew bundle'
  204. - run: "while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done"
  205. name: 'brew install'
  206. - run: |
  207. case "${{ matrix.build.install }}" in
  208. *openssl*)
  209. ;;
  210. *)
  211. if test -d /usr/local/include/openssl; then
  212. brew unlink openssl
  213. fi;;
  214. esac
  215. name: 'brew unlink openssl'
  216. - uses: actions/checkout@v4
  217. - run: cmake -S. -Bbuild -DCURL_WERROR=ON -DPICKY_COMPILER=ON ${{ matrix.build.generate }}
  218. name: 'cmake generate'
  219. - run: cmake --build build
  220. name: 'cmake build'