macos.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # Copyright (C) 2000 - 2022 Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: macOS
  5. on:
  6. # Trigger the workflow on push or pull requests, but only for the
  7. # master branch
  8. push:
  9. branches:
  10. - master
  11. - '*/ci'
  12. pull_request:
  13. branches:
  14. - master
  15. jobs:
  16. autotools:
  17. name: ${{ matrix.build.name }}
  18. runs-on: 'macos-latest'
  19. timeout-minutes: 90
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. build:
  24. - name: normal
  25. install: nghttp2
  26. configure: --without-ssl
  27. macosx-version-min: 10.9
  28. - name: debug
  29. install: nghttp2
  30. configure: --enable-debug --without-ssl
  31. macosx-version-min: 10.9
  32. - name: libssh2
  33. install: nghttp2 libssh2
  34. configure: --enable-debug --with-libssh2 --without-ssl
  35. macosx-version-min: 10.9
  36. - name: libssh-c-ares
  37. install: openssl nghttp2 libssh
  38. configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl --enable-ares
  39. macosx-version-min: 10.9
  40. - name: libssh
  41. install: openssl nghttp2 libssh
  42. configure: --enable-debug --with-libssh --with-openssl=/usr/local/opt/openssl
  43. macosx-version-min: 10.9
  44. - name: c-ares
  45. install: nghttp2
  46. configure: --enable-debug --enable-ares --without-ssl
  47. macosx-version-min: 10.9
  48. - name: HTTP only
  49. install: nghttp2
  50. configure: --enable-debug --enable-maintainer-mode --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets --disable-shared --without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp --without-libssh2 --without-nghttp2 --without-ntlm-auth --without-ssl --without-zlib
  51. macosx-version-min: 10.15
  52. - name: SecureTransport http2
  53. install: nghttp2
  54. configure: --enable-debug --with-secure-transport
  55. macosx-version-min: 10.8
  56. - name: OpenSSL http2
  57. install: nghttp2 openssl
  58. configure: --enable-debug --with-openssl=/usr/local/opt/openssl
  59. macosx-version-min: 10.9
  60. - name: LibreSSL http2
  61. install: nghttp2 libressl
  62. configure: --enable-debug --with-openssl=/usr/local/opt/libressl
  63. macosx-version-min: 10.9
  64. - name: torture
  65. install: nghttp2 openssl
  66. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl
  67. tflags: -n -t --shallow=25 !FTP
  68. macosx-version-min: 10.9
  69. - name: torture-ftp
  70. install: nghttp2 openssl
  71. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl=/usr/local/opt/openssl
  72. tflags: -n -t --shallow=20 FTP
  73. macosx-version-min: 10.9
  74. - name: macOS 10.15
  75. install: nghttp2 libssh2 openssl
  76. configure: --enable-debug --disable-ldap --with-openssl=/usr/local/opt/openssl
  77. macosx-version-min: 10.15
  78. steps:
  79. - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  80. name: 'brew bundle'
  81. # Run this command with retries because of spurious failures seen
  82. # while running the tests, for example
  83. # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
  84. - run: brew update && for i in 1 2 3; do brew bundle install --no-lock --file /tmp/Brewfile && break || sleep 1; done
  85. name: 'brew install'
  86. - run: python3 -m pip install impacket
  87. name: 'pip3 install'
  88. - uses: actions/checkout@v3
  89. - run: autoreconf -fi
  90. name: 'autoreconf'
  91. - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }}
  92. name: 'configure'
  93. env:
  94. # -Wvla is caused by brotli
  95. CFLAGS: "-Wno-vla -mmacosx-version-min=${{ matrix.build.macosx-version-min }}"
  96. - run: make V=1
  97. name: 'make'
  98. - run: make V=1 examples
  99. name: 'make examples'
  100. - run: make V=1 test-ci
  101. name: 'test'
  102. env:
  103. TFLAGS: "${{ matrix.build.tflags }} ~1452"
  104. cmake:
  105. name: cmake ${{ matrix.compiler.CC }} ${{ matrix.build.name }}
  106. runs-on: 'macos-latest'
  107. env: ${{ matrix.compiler }}
  108. strategy:
  109. fail-fast: false
  110. matrix:
  111. compiler:
  112. - CC: clang
  113. CXX: clang++
  114. CFLAGS: "-mmacosx-version-min=10.15 -Wno-deprecated-declarations"
  115. - CC: gcc-9
  116. CXX: g++-9
  117. CFLAGS: "-mmacosx-version-min=10.15 -Wno-error=undef -Wno-error=conversion"
  118. build:
  119. - name: OpenSSL
  120. install: nghttp2 openssl
  121. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON
  122. - name: LibreSSL
  123. install: nghttp2 libressl
  124. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/libressl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON
  125. - name: libssh2
  126. install: nghttp2 openssl libssh2
  127. generate: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_USE_LIBSSH2=ON
  128. steps:
  129. - run: echo libtool autoconf automake pkg-config ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  130. name: 'brew bundle'
  131. - run: brew update && brew bundle install --no-lock --file /tmp/Brewfile
  132. name: 'brew install'
  133. - run: python3 -m pip install impacket
  134. name: 'pip3 install'
  135. - uses: actions/checkout@v3
  136. - run: cmake -S. -Bbuild -DCURL_WERROR=ON -DPICKY_COMPILER=ON ${{ matrix.build.generate }}
  137. name: 'cmake generate'
  138. - run: cmake --build build
  139. name: 'cmake build'