macos.yml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.*'
  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.*'
  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.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=$(brew --prefix)/opt/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=$(brew --prefix)/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=$(brew --prefix)/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. # fails now with linker error on missing symbols, macos no longer old enough?
  113. # - name: gcc SecureTransport
  114. # configure: CC=gcc-12 --enable-debug --with-secure-transport --enable-websockets --without-libpsl
  115. # macosx-version-min: 10.8
  116. - name: OpenSSL http2
  117. install: nghttp2 openssl
  118. configure: --enable-debug --with-openssl=$(brew --prefix)/opt/openssl --enable-websockets
  119. macosx-version-min: 10.9
  120. - name: LibreSSL http2
  121. install: nghttp2 libressl
  122. configure: --enable-debug --with-openssl=$(brew --prefix)/opt/libressl --enable-websockets
  123. macosx-version-min: 10.9
  124. - name: torture
  125. install: nghttp2 openssl
  126. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=$(brew --prefix)/opt/openssl --enable-websockets
  127. tflags: -n -t --shallow=25 !FTP
  128. macosx-version-min: 10.9
  129. - name: torture-ftp
  130. install: nghttp2 openssl
  131. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=$(brew --prefix)/opt/openssl --enable-websockets
  132. tflags: -n -t --shallow=20 FTP
  133. macosx-version-min: 10.9
  134. - name: macOS 10.15
  135. install: nghttp2 libssh2 openssl
  136. configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix)/opt/openssl --enable-websockets
  137. macosx-version-min: 10.15
  138. steps:
  139. - run: echo libtool autoconf automake pkg-config libpsl ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  140. name: 'brew bundle'
  141. # Run this command with retries because of spurious failures seen
  142. # while running the tests, for example
  143. # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
  144. - 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"
  145. name: 'brew install'
  146. - run: |
  147. case "${{ matrix.build.install }}" in
  148. *openssl*)
  149. (
  150. cd $(brew --prefix)/opt/openssl/lib/pkgconfig/
  151. for i in libssl.pc libcrypto.pc; do
  152. sudo cp $i $i.orig
  153. sudo sed s,libdir=$(brew --prefix)'/Cellar/openssl@3/3.3.0$',libdir=$(brew --prefix)/Cellar/openssl@3/3.3.0/lib,g < $i.orig > /tmp/$i
  154. sudo cp /tmp/$i $i
  155. cat $i
  156. done
  157. )
  158. ;;
  159. *)
  160. if test -d $(brew --prefix)/include/openssl; then
  161. brew unlink openssl
  162. fi;;
  163. esac
  164. name: 'brew unlink openssl'
  165. - run: |
  166. python3 -m venv $HOME/venv
  167. source $HOME/venv/bin/activate
  168. python3 -m pip install impacket
  169. name: 'pip3 install'
  170. - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
  171. - run: rm -f $HOME/.curlrc
  172. name: remove $HOME/.curlrc
  173. - run: autoreconf -fi
  174. name: 'autoreconf'
  175. - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }}
  176. name: 'configure'
  177. env:
  178. CFLAGS: "-mmacosx-version-min=${{ matrix.build.macosx-version-min }}"
  179. - run: make V=1
  180. name: 'make'
  181. - run: make V=1 examples
  182. name: 'make examples'
  183. - run: make V=1 -C tests
  184. name: 'make tests'
  185. - run: make V=1 test-ci
  186. name: 'run tests'
  187. env:
  188. TFLAGS: "${{ matrix.build.tflags }} ~1452"
  189. cmake:
  190. name: cmake ${{ matrix.compiler.CC }} ${{ matrix.build.name }}
  191. runs-on: 'macos-latest'
  192. env:
  193. CC: ${{ matrix.compiler.CC }}
  194. # '-Wno-deprecated-declarations' required for LDAP and BUILD_EXAMPLES
  195. CFLAGS: '-DCMAKE_C_FLAGS=-mmacosx-version-min=10.15 -Wno-deprecated-declarations'
  196. strategy:
  197. fail-fast: false
  198. matrix:
  199. compiler:
  200. - CC: clang
  201. - CC: gcc-12
  202. build:
  203. - name: OpenSSL
  204. install: nghttp2 openssl
  205. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
  206. - name: LibreSSL
  207. install: nghttp2 libressl
  208. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DBUILD_EXAMPLES=ON
  209. - name: libssh2
  210. install: nghttp2 openssl libssh2
  211. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix)/opt/openssl -DCURL_USE_LIBSSH2=ON -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON
  212. - name: GnuTLS
  213. install: gnutls
  214. generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCMAKE_SHARED_LINKER_FLAGS=-L$(brew --prefix)/lib -DCMAKE_EXE_LINKER_FLAGS=-L$(brew --prefix)/lib
  215. steps:
  216. - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  217. name: 'brew bundle'
  218. - 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"
  219. name: 'brew install'
  220. - run: |
  221. case "${{ matrix.build.install }}" in
  222. *openssl*)
  223. ;;
  224. *)
  225. if test -d $(brew --prefix)/include/openssl; then
  226. brew unlink openssl
  227. fi;;
  228. esac
  229. name: 'brew unlink openssl'
  230. - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
  231. - run: cmake -B build -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DUSE_APPLE_IDN=ON ${{ matrix.build.generate }}
  232. name: 'cmake generate'
  233. - run: cmake --build build --parallel 3
  234. name: 'cmake build'