linux.yml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: Linux
  5. 'on':
  6. push:
  7. branches:
  8. - master
  9. - '*/ci'
  10. paths-ignore:
  11. - '**/*.md'
  12. - '.circleci/**'
  13. - 'appveyor.*'
  14. - 'packages/**'
  15. - 'plan9/**'
  16. - 'projects/**'
  17. - 'winbuild/**'
  18. pull_request:
  19. branches:
  20. - master
  21. paths-ignore:
  22. - '**/*.md'
  23. - '.circleci/**'
  24. - 'appveyor.*'
  25. - 'packages/**'
  26. - 'plan9/**'
  27. - 'projects/**'
  28. - 'winbuild/**'
  29. concurrency:
  30. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  31. cancel-in-progress: true
  32. permissions: {}
  33. env:
  34. MAKEFLAGS: -j 5
  35. # unhandled
  36. bearssl-version: 0.6
  37. # renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
  38. libressl-version: 4.0.0
  39. # renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
  40. wolfssl-version: 5.7.4
  41. # renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com
  42. mbedtls-version: 3.6.2
  43. # renovate: datasource=github-tags depName=nibanks/msh3 versioning=semver registryUrl=https://github.com
  44. msh3-version: 0.6.0
  45. # renovate: datasource=github-tags depName=awslabs/aws-lc versioning=semver registryUrl=https://github.com
  46. awslc-version: 1.40.0
  47. # handled in renovate.json
  48. openssl-version: 3.4.0
  49. # handled in renovate.json
  50. quictls-version: 3.3.0
  51. # renovate: datasource=github-tags depName=rustls/rustls-ffi versioning=semver registryUrl=https://github.com
  52. rustls-version: 0.14.1
  53. jobs:
  54. linux:
  55. name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
  56. runs-on: 'ubuntu-24.04'
  57. container: ${{ matrix.build.container }}
  58. timeout-minutes: 45
  59. strategy:
  60. fail-fast: false
  61. matrix:
  62. build:
  63. - name: bearssl
  64. install_packages: zlib1g-dev
  65. install_steps: bearssl pytest
  66. configure: LDFLAGS="-Wl,-rpath,$HOME/bearssl/lib" --with-bearssl=$HOME/bearssl --enable-debug
  67. - name: bearssl clang
  68. install_packages: zlib1g-dev clang
  69. install_steps: bearssl
  70. configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/bearssl/lib" --with-bearssl=$HOME/bearssl --enable-debug
  71. - name: libressl heimdal
  72. install_packages: zlib1g-dev heimdal-dev
  73. install_steps: libressl pytest
  74. configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --with-gssapi --enable-debug
  75. - name: libressl heimdal valgrind
  76. install_packages: zlib1g-dev heimdal-dev valgrind
  77. install_steps: libressl pytest
  78. generate: -DOPENSSL_ROOT_DIR=$HOME/libressl -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
  79. - name: libressl clang
  80. install_packages: zlib1g-dev clang
  81. install_steps: libressl
  82. configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug
  83. - name: wolfssl-all
  84. install_packages: zlib1g-dev
  85. install_steps: wolfssl-all
  86. configure: LDFLAGS="-Wl,-rpath,$HOME/wolfssl-all/lib" --with-wolfssl=$HOME/wolfssl-all --enable-ech --enable-debug
  87. - name: wolfssl-opensslextra valgrind
  88. install_packages: zlib1g-dev valgrind
  89. install_steps: wolfssl-opensslextra
  90. configure: LDFLAGS="-Wl,-rpath,$HOME/wolfssl-opensslextra/lib" --with-wolfssl=$HOME/wolfssl-opensslextra --enable-debug
  91. - name: mbedtls valgrind
  92. install_packages: libnghttp2-dev valgrind
  93. install_steps: mbedtls pytest
  94. configure: LDFLAGS="-Wl,-rpath,$HOME/mbedtls/lib" --with-mbedtls=$HOME/mbedtls --enable-debug
  95. - name: mbedtls clang
  96. install_packages: libnghttp2-dev clang
  97. install_steps: mbedtls
  98. configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/mbedtls/lib" --with-mbedtls=$HOME/mbedtls --enable-debug
  99. - name: mbedtls
  100. install_packages: libnghttp2-dev
  101. install_steps: mbedtls
  102. PKG_CONFIG_PATH: '$HOME/mbedtls/lib/pkgconfig' # Requires v3.6.0 or v2.28.8
  103. generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON
  104. - name: mbedtls-pkg
  105. install_packages: libnghttp2-dev libmbedtls-dev
  106. generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF
  107. - name: mbedtls-pkg !pc
  108. install_packages: libnghttp2-dev libmbedtls-dev
  109. install_steps: skipall
  110. generate: -DCURL_USE_MBEDTLS=ON -DENABLE_DEBUG=ON -DCURL_USE_PKGCONFIG=OFF
  111. - name: msh3
  112. install_packages: zlib1g-dev
  113. install_steps: quictls msh3
  114. configure: LDFLAGS="-Wl,-rpath,$HOME/msh3/lib -Wl,-rpath,$HOME/quictls/lib" --with-msh3=$HOME/msh3 --with-openssl=$HOME/quictls --enable-debug
  115. - name: msh3
  116. install_packages: zlib1g-dev
  117. install_steps: quictls msh3 skipall
  118. PKG_CONFIG_PATH: '$HOME/msh3/lib/pkgconfig' # Broken as of v0.6.0
  119. generate: -DOPENSSL_ROOT_DIR=$HOME/quictls -DUSE_MSH3=ON -DMSH3_INCLUDE_DIR=$HOME/msh3/include -DMSH3_LIBRARY=$HOME/msh3/lib/libmsh3.so -DENABLE_DEBUG=ON
  120. - name: awslc
  121. install_packages: zlib1g-dev
  122. install_steps: awslc
  123. configure: LDFLAGS="-Wl,-rpath,$HOME/awslc/lib" --with-openssl=$HOME/awslc --enable-ech
  124. - name: awslc
  125. install_packages: zlib1g-dev
  126. install_steps: awslc
  127. generate: -DOPENSSL_ROOT_DIR=$HOME/awslc -DUSE_ECH=ON -DCMAKE_UNITY_BUILD=OFF
  128. - name: openssl default
  129. install_steps: pytest
  130. configure: --with-openssl --enable-debug --disable-unity
  131. - name: openssl libssh2 sync-resolver valgrind
  132. install_packages: zlib1g-dev libssh2-1-dev valgrind
  133. install_steps: pytest
  134. configure: --with-openssl --enable-debug --disable-threaded-resolver --with-libssh2
  135. - name: openssl
  136. install_packages: zlib1g-dev
  137. install_steps: pytest
  138. configure: CFLAGS=-std=gnu89 --with-openssl --enable-debug
  139. - name: openssl -O3 valgrind
  140. install_packages: zlib1g-dev valgrind
  141. configure: CPPFLAGS=-DCURL_WARN_SIGN_CONVERSION CFLAGS=-O3 --with-openssl --enable-debug
  142. - name: openssl clang krb5
  143. install_packages: zlib1g-dev libkrb5-dev clang
  144. configure: CC=clang --with-openssl --with-gssapi --enable-debug --disable-docs --disable-manual
  145. - name: openssl clang krb5
  146. install_packages: zlib1g-dev libkrb5-dev clang
  147. install_steps: skipall
  148. generate: -DCURL_USE_OPENSSL=ON -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON
  149. - name: openssl !ipv6
  150. configure: --with-openssl --disable-ipv6 --enable-debug --disable-unity
  151. - name: openssl https-only
  152. configure: >-
  153. --with-openssl --enable-debug --disable-unity
  154. --disable-dict --disable-gopher --disable-ldap --disable-telnet
  155. --disable-imap --disable-pop3 --disable-smtp
  156. --disable-rtmp --disable-rtsp
  157. --disable-scp --disable-sftp --disable-tftp --disable-ftp --disable-file --disable-smb
  158. - name: openssl torture !FTP
  159. install_packages: zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev
  160. generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON
  161. tflags: -t --shallow=25 !FTP
  162. torture: true
  163. - name: openssl torture FTP
  164. install_packages: zlib1g-dev libnghttp2-dev libssh2-1-dev libc-ares-dev
  165. generate: -DCURL_USE_OPENSSL=ON -DENABLE_DEBUG=ON -DENABLE_ARES=ON
  166. tflags: -t --shallow=20 FTP
  167. torture: true
  168. - name: openssl i686
  169. install_packages: gcc-14-i686-linux-gnu libssl-dev:i386 librtmp-dev:i386 libssh2-1-dev:i386 libidn2-0-dev:i386 libc-ares-dev:i386 zlib1g-dev:i386
  170. configure: >-
  171. PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig
  172. CC=i686-linux-gnu-gcc-14
  173. CPPFLAGS=-I/usr/include/i386-linux-gnu
  174. LDFLAGS=-L/usr/lib/i386-linux-gnu
  175. --host=i686-linux-gnu
  176. --with-openssl --with-librtmp --with-libssh2 --with-libidn2 --enable-ares --enable-debug
  177. - name: '!ssl !http !smtp !imap'
  178. configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity
  179. - name: scanbuild
  180. install_packages: clang-tools clang libssl-dev libssh2-1-dev
  181. install_steps: skipall
  182. configure: --with-openssl --enable-debug --with-libssh2 --disable-unity
  183. configure-prefix: CC=clang scan-build
  184. make-prefix: scan-build --status-bugs
  185. - name: address-sanitizer
  186. install_packages: zlib1g-dev libssh2-1-dev clang libssl-dev libubsan1 libasan8 libtsan2
  187. install_steps: pytest
  188. configure: >-
  189. CC=clang
  190. CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g"
  191. LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer"
  192. LIBS="-ldl -lubsan"
  193. --with-openssl --enable-debug
  194. - name: thread-sanitizer
  195. install_packages: zlib1g-dev clang libtsan2
  196. install_steps: pytest openssl-tsan
  197. configure: >-
  198. CC=clang
  199. CFLAGS="-fsanitize=thread -g"
  200. LDFLAGS="-fsanitize=thread -Wl,-rpath,$HOME/openssl/lib"
  201. --with-openssl=$HOME/openssl --enable-debug
  202. - name: memory-sanitizer
  203. install_packages: clang
  204. configure: >-
  205. CC=clang
  206. CFLAGS="-fsanitize=memory -Wformat -Werror=format-security -Werror=array-bounds -g"
  207. LDFLAGS="-fsanitize=memory"
  208. LIBS="-ldl"
  209. --without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug
  210. - name: event-based
  211. install_packages: libssh-dev
  212. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl
  213. tflags: -n --test-event '!TLS-SRP'
  214. - name: duphandle
  215. install_packages: libssh-dev
  216. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl
  217. tflags: -n --test-duphandle '!TLS-SRP'
  218. - name: rustls valgrind
  219. install_packages: valgrind
  220. install_steps: rust rustls pytest
  221. configure: --with-rustls=$HOME/rustls --enable-debug
  222. - name: rustls
  223. install_steps: rust rustls skipall
  224. PKG_CONFIG_PATH: '$HOME/rustls/lib/pkgconfig' # Not built as of v0.14.0
  225. generate: -DCURL_USE_RUSTLS=ON -DRUSTLS_INCLUDE_DIR=$HOME/rustls/include -DRUSTLS_LIBRARY=$HOME/rustls/lib/librustls.a -DENABLE_DEBUG=ON
  226. - name: IntelC openssl
  227. install_packages: zlib1g-dev libssl-dev
  228. install_steps: intel
  229. configure: CC=icc --enable-debug --with-openssl
  230. - name: Slackware openssl gssapi gcc
  231. # These are essentially the same flags used to build the curl Slackware package
  232. # https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild
  233. configure: --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs
  234. # Docker Hub image that `container-job` executes in
  235. container: 'andy5995/slackware-build-essential:15.0'
  236. - name: Alpine MUSL
  237. configure: --enable-debug --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl
  238. container: 'alpine:3.18'
  239. steps:
  240. - if: matrix.build.container == null && !contains(matrix.build.name, 'i686')
  241. run: |
  242. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  243. sudo apt-get update -y
  244. sudo apt-get install -y --no-install-suggests --no-install-recommends \
  245. libtool autoconf automake pkgconf ninja-build stunnel4 \
  246. libpsl-dev libbrotli-dev libzstd-dev \
  247. ${{ matrix.build.install_packages }}
  248. python3 -m venv $HOME/venv
  249. name: 'install prereqs'
  250. - if: contains(matrix.build.name, 'i686')
  251. run: |
  252. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  253. sudo dpkg --add-architecture i386
  254. sudo apt-get update -y
  255. sudo apt-get install -y --no-install-suggests --no-install-recommends \
  256. libtool autoconf automake pkgconf stunnel4 \
  257. libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \
  258. ${{ matrix.build.install_packages }}
  259. python3 -m venv $HOME/venv
  260. name: 'install prereqs'
  261. - if: contains(matrix.build.install_steps, 'pytest')
  262. run: |
  263. sudo apt-get install -y --no-install-suggests --no-install-recommends \
  264. apache2 apache2-dev libnghttp2-dev vsftpd
  265. name: 'install prereqs for pytest'
  266. - if: startsWith(matrix.build.container, 'alpine')
  267. run: |
  268. apk add --no-cache build-base autoconf automake libtool perl openssl-dev libssh2-dev \
  269. zlib-dev brotli-dev zstd-dev libidn2-dev openldap-dev heimdal-dev libpsl-dev \
  270. py3-impacket py3-asn1 py3-six py3-pycryptodomex \
  271. perl-time-hires openssh stunnel sudo git
  272. name: 'install dependencies'
  273. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  274. with:
  275. persist-credentials: false
  276. - name: 'Fix kernel mmap rnd bits'
  277. # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
  278. # high-entropy ASLR in much newer kernels that GitHub runners are
  279. # using leading to random crashes: https://reviews.llvm.org/D148280
  280. # See https://github.com/actions/runner-images/issues/9491
  281. continue-on-error: true
  282. run: sudo sysctl vm.mmap_rnd_bits=28
  283. - name: 'cache bearssl'
  284. if: contains(matrix.build.install_steps, 'bearssl')
  285. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  286. id: cache-bearssl
  287. env:
  288. cache-name: cache-bearssl
  289. with:
  290. path: /home/runner/bearssl
  291. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.bearssl-version }}
  292. - name: 'build bearssl'
  293. if: contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true'
  294. run: |
  295. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  296. https://bearssl.org/bearssl-${{ env.bearssl-version }}.tar.gz
  297. tar -xzf bearssl-${{ env.bearssl-version }}.tar.gz
  298. cd bearssl-${{ env.bearssl-version }}
  299. make
  300. mkdir -p $HOME/bearssl/lib $HOME/bearssl/include
  301. cp inc/*.h $HOME/bearssl/include
  302. cp build/libbearssl.* $HOME/bearssl/lib
  303. - name: 'cache libressl'
  304. if: contains(matrix.build.install_steps, 'libressl')
  305. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  306. id: cache-libressl
  307. env:
  308. cache-name: cache-libressl
  309. with:
  310. path: /home/runner/libressl
  311. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.libressl-version }}
  312. - name: 'build libressl'
  313. if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true'
  314. run: |
  315. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  316. https://github.com/libressl/portable/releases/download/v${{ env.libressl-version }}/libressl-${{ env.libressl-version }}.tar.gz
  317. tar -xzf libressl-${{ env.libressl-version }}.tar.gz
  318. cd libressl-${{ env.libressl-version }}
  319. ./configure --disable-dependency-tracking --prefix=$HOME/libressl
  320. make install
  321. - name: 'cache wolfssl (all)'
  322. if: contains(matrix.build.install_steps, 'wolfssl-all')
  323. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  324. id: cache-wolfssl-all
  325. env:
  326. cache-name: cache-wolfssl-all
  327. with:
  328. path: /home/runner/wolfssl-all
  329. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  330. - name: 'build wolfssl (all)'
  331. if: contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true'
  332. run: |
  333. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  334. https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz
  335. tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz
  336. cd wolfssl-${{ env.wolfssl-version }}-stable
  337. ./autogen.sh
  338. ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --enable-all \
  339. --disable-benchmark --disable-crypttests --disable-examples --prefix=$HOME/wolfssl-all
  340. make install
  341. - name: 'cache wolfssl (opensslextra)'
  342. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra')
  343. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  344. id: cache-wolfssl-opensslextra
  345. env:
  346. cache-name: cache-wolfssl-opensslextra
  347. with:
  348. path: /home/runner/wolfssl-opensslextra
  349. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  350. - name: 'build wolfssl (opensslextra)'
  351. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true'
  352. run: |
  353. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  354. https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz
  355. tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz
  356. cd wolfssl-${{ env.wolfssl-version }}-stable
  357. ./autogen.sh
  358. ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --enable-opensslextra \
  359. --disable-benchmark --disable-crypttests --disable-examples --prefix=$HOME/wolfssl-opensslextra
  360. make install
  361. - name: 'cache mbedtls'
  362. if: contains(matrix.build.install_steps, 'mbedtls')
  363. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  364. id: cache-mbedtls
  365. env:
  366. cache-name: cache-mbedtls-threadsafe
  367. with:
  368. path: /home/runner/mbedtls
  369. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mbedtls-version }}
  370. - name: 'build mbedtls'
  371. if: contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls.outputs.cache-hit != 'true'
  372. run: |
  373. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  374. https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${{ env.mbedtls-version }}/mbedtls-${{ env.mbedtls-version }}.tar.bz2
  375. tar -xjf mbedtls-${{ env.mbedtls-version }}.tar.bz2
  376. cd mbedtls-${{ env.mbedtls-version }}
  377. ./scripts/config.py set MBEDTLS_THREADING_C
  378. ./scripts/config.py set MBEDTLS_THREADING_PTHREAD
  379. cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$HOME/mbedtls \
  380. -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
  381. cmake --build .
  382. cmake --install .
  383. - name: 'cache openssl (thread sanitizer)'
  384. if: contains(matrix.build.install_steps, 'openssl-tsan')
  385. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  386. id: cache-openssl-tsan
  387. env:
  388. cache-name: cache-openssl-tsan
  389. with:
  390. path: /home/runner/openssl
  391. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.openssl-version }}
  392. - name: 'build openssl (thread sanitizer)'
  393. if: contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true'
  394. run: |
  395. git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/openssl/openssl
  396. cd openssl
  397. CC="clang" CFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread" ./config --prefix=$HOME/openssl --libdir=lib no-makedepend no-apps no-docs no-tests
  398. make
  399. make -j1 install_sw
  400. - name: 'cache quictls'
  401. if: contains(matrix.build.install_steps, 'quictls')
  402. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  403. id: cache-quictls
  404. env:
  405. cache-name: cache-quictls
  406. with:
  407. path: /home/runner/quictls
  408. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1
  409. - name: 'build quictls'
  410. if: contains(matrix.build.install_steps, 'quictls') && steps.cache-quictls.outputs.cache-hit != 'true'
  411. run: |
  412. git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }}-quic1 https://github.com/quictls/openssl
  413. cd openssl
  414. ./config --prefix=$HOME/quictls --libdir=lib no-makedepend no-apps no-docs no-tests
  415. make
  416. make -j1 install_sw
  417. - name: 'cache msh3'
  418. if: contains(matrix.build.install_steps, 'msh3')
  419. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  420. id: cache-msh3
  421. env:
  422. cache-name: cache-msh3
  423. with:
  424. path: /home/runner/msh3
  425. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.msh3-version }}
  426. - name: 'build msh3'
  427. if: contains(matrix.build.install_steps, 'msh3') && steps.cache-msh3.outputs.cache-hit != 'true'
  428. run: |
  429. git clone --quiet --depth=1 -b v${{ env.msh3-version }} --recursive https://github.com/nibanks/msh3
  430. cd msh3
  431. cmake -B . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/msh3
  432. cmake --build .
  433. cmake --install .
  434. - name: 'cache awslc'
  435. if: contains(matrix.build.install_steps, 'awslc')
  436. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  437. id: cache-awslc
  438. env:
  439. cache-name: cache-awslc
  440. with:
  441. path: /home/runner/awslc
  442. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.awslc-version }}
  443. - name: 'build awslc'
  444. if: contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true'
  445. run: |
  446. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  447. https://github.com/awslabs/aws-lc/archive/refs/tags/v${{ env.awslc-version }}.tar.gz
  448. tar xzf v${{ env.awslc-version }}.tar.gz
  449. mkdir aws-lc-${{ env.awslc-version }}-build
  450. cd aws-lc-${{ env.awslc-version }}-build
  451. cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/awslc ../aws-lc-${{ env.awslc-version }} -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF
  452. cmake --build .
  453. cmake --install .
  454. - name: 'cache rustls'
  455. if: contains(matrix.build.install_steps, 'rustls')
  456. uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
  457. id: cache-rustls
  458. env:
  459. cache-name: cache-rustls
  460. with:
  461. path: /home/runner/rustls
  462. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.rustls-version }}
  463. - name: 'install rust'
  464. if: contains(matrix.build.install_steps, 'rust') && steps.cache-rustls.outputs.cache-hit != 'true'
  465. run: |
  466. cd $HOME
  467. curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y
  468. source $HOME/.cargo/env
  469. rustup toolchain install nightly
  470. - name: 'build rustls'
  471. if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true'
  472. run: |
  473. git clone --quiet --depth=1 -b v${{ env.rustls-version }} --recursive https://github.com/rustls/rustls-ffi.git
  474. cd rustls-ffi
  475. make DESTDIR=$HOME/rustls install
  476. - if: contains(matrix.build.install_steps, 'intel')
  477. run: |
  478. cd /tmp
  479. curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add -
  480. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  481. sudo apt install --no-install-recommends intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
  482. source /opt/intel/oneapi/setvars.sh
  483. printenv >> $GITHUB_ENV
  484. name: 'install Intel compilers'
  485. - run: autoreconf -fi
  486. if: ${{ matrix.build.configure }}
  487. name: 'autoreconf'
  488. - name: 'configure'
  489. run: |
  490. [[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt remove --yes libssl-dev
  491. if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then
  492. export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
  493. fi
  494. if [ -n '${{ matrix.build.generate }}' ]; then
  495. cmake -B . -G Ninja \
  496. -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
  497. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
  498. ${{ matrix.build.generate }}
  499. else
  500. ${{ matrix.build.configure-prefix }} \
  501. ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  502. ${{ matrix.build.configure }}
  503. fi
  504. - name: 'configure log'
  505. if: ${{ !cancelled() }}
  506. run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
  507. - name: 'curl_config.h'
  508. run: |
  509. echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::'
  510. grep -F '#define' lib/curl_config.h | sort || true
  511. - name: 'test configs'
  512. run: |
  513. cat tests/config || true
  514. cat tests/http/config.ini || true
  515. - name: 'build'
  516. run: |
  517. if [ -n '${{ matrix.build.generate }}' ]; then
  518. ${{ matrix.build.make-prefix }} cmake --build . --verbose
  519. else
  520. ${{ matrix.build.make-prefix }} make V=1
  521. fi
  522. - name: 'single-use function check'
  523. if: ${{ contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF') }}
  524. run: |
  525. git config --global --add safe.directory "*"
  526. if [ -n '${{ matrix.build.generate }}' ]; then
  527. libcurla=lib/libcurl.a
  528. else
  529. libcurla=lib/.libs/libcurl.a
  530. fi
  531. ./scripts/singleuse.pl --unit ${libcurla}
  532. - run: ./src/curl -V
  533. name: 'check curl -V output'
  534. - run: cmake --install . --prefix $HOME/curl --strip
  535. if: ${{ matrix.build.generate }}
  536. name: 'cmake install'
  537. - name: 'build tests'
  538. if: ${{ matrix.build.install_steps != 'skipall' }}
  539. run: |
  540. if [ -n '${{ matrix.build.generate }}' ]; then
  541. cmake --build . --verbose --target testdeps
  542. else
  543. make V=1 -C tests
  544. fi
  545. - name: 'install test prereqs'
  546. if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.container == null }}
  547. run: |
  548. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  549. python3 -m pip install -r tests/requirements.txt
  550. - name: 'run tests'
  551. if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' }}
  552. timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 30 || 15 }}
  553. run: |
  554. export TFLAGS='${{ matrix.build.tflags }}'
  555. if [ -z '${{ matrix.build.torture }}' ]; then
  556. if [[ '${{ matrix.build.install_packages }}' = *'valgrind'* ]]; then
  557. TFLAGS+=' -j6'
  558. fi
  559. if [[ '${{ matrix.build.install_packages }}' = *'heimdal-dev'* ]]; then
  560. TFLAGS+=' ~2077 ~2078' # valgrind errors
  561. fi
  562. fi
  563. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  564. if [ -n '${{ matrix.build.generate }}' ]; then
  565. cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  566. else
  567. make V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  568. fi
  569. - name: 'install pytest prereqs'
  570. if: contains(matrix.build.install_steps, 'pytest')
  571. run: |
  572. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  573. python3 -m pip install -r tests/http/requirements.txt
  574. - name: 'run pytest'
  575. if: contains(matrix.build.install_steps, 'pytest')
  576. env:
  577. TFLAGS: "${{ matrix.build.tflags }}"
  578. CURL_CI: github
  579. run: |
  580. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  581. if [ -n '${{ matrix.build.generate }}' ]; then
  582. cmake --build . --verbose --target curl-pytest-ci
  583. else
  584. make V=1 pytest-ci
  585. fi
  586. - name: 'build examples'
  587. run: |
  588. if [ -n '${{ matrix.build.generate }}' ]; then
  589. ${{ matrix.build.make-prefix }} cmake --build . --verbose --target curl-examples
  590. else
  591. ${{ matrix.build.make-prefix }} make V=1 examples
  592. fi