2
0

linux.yml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  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.39.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.0
  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-httpsrr --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
  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-httpsrr --enable-ech
  124. - name: awslc
  125. install_packages: zlib1g-dev
  126. install_steps: awslc
  127. generate: -DOPENSSL_ROOT_DIR=$HOME/awslc -DUSE_HTTPSRR=ON -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
  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. - name: 'Fix kernel mmap rnd bits'
  275. # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
  276. # high-entropy ASLR in much newer kernels that GitHub runners are
  277. # using leading to random crashes: https://reviews.llvm.org/D148280
  278. # See https://github.com/actions/runner-images/issues/9491
  279. continue-on-error: true
  280. run: sudo sysctl vm.mmap_rnd_bits=28
  281. - name: 'cache bearssl'
  282. if: contains(matrix.build.install_steps, 'bearssl')
  283. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  284. id: cache-bearssl
  285. env:
  286. cache-name: cache-bearssl
  287. with:
  288. path: /home/runner/bearssl
  289. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.bearssl-version }}
  290. - name: 'build bearssl'
  291. if: contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true'
  292. run: |
  293. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  294. https://bearssl.org/bearssl-${{ env.bearssl-version }}.tar.gz
  295. tar -xzf bearssl-${{ env.bearssl-version }}.tar.gz
  296. cd bearssl-${{ env.bearssl-version }}
  297. make
  298. mkdir -p $HOME/bearssl/lib $HOME/bearssl/include
  299. cp inc/*.h $HOME/bearssl/include
  300. cp build/libbearssl.* $HOME/bearssl/lib
  301. - name: 'cache libressl'
  302. if: contains(matrix.build.install_steps, 'libressl')
  303. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  304. id: cache-libressl
  305. env:
  306. cache-name: cache-libressl
  307. with:
  308. path: /home/runner/libressl
  309. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.libressl-version }}
  310. - name: 'build libressl'
  311. if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true'
  312. run: |
  313. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  314. https://github.com/libressl/portable/releases/download/v${{ env.libressl-version }}/libressl-${{ env.libressl-version }}.tar.gz
  315. tar -xzf libressl-${{ env.libressl-version }}.tar.gz
  316. cd libressl-${{ env.libressl-version }}
  317. ./configure --disable-dependency-tracking --prefix=$HOME/libressl
  318. make install
  319. - name: 'cache wolfssl (all)'
  320. if: contains(matrix.build.install_steps, 'wolfssl-all')
  321. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  322. id: cache-wolfssl-all
  323. env:
  324. cache-name: cache-wolfssl-all
  325. with:
  326. path: /home/runner/wolfssl-all
  327. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  328. - name: 'build wolfssl (all)'
  329. if: contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true'
  330. run: |
  331. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  332. https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz
  333. tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz
  334. cd wolfssl-${{ env.wolfssl-version }}-stable
  335. ./autogen.sh
  336. ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --enable-all \
  337. --disable-benchmark --disable-crypttests --disable-examples --prefix=$HOME/wolfssl-all
  338. make install
  339. - name: 'cache wolfssl (opensslextra)'
  340. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra')
  341. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  342. id: cache-wolfssl-opensslextra
  343. env:
  344. cache-name: cache-wolfssl-opensslextra
  345. with:
  346. path: /home/runner/wolfssl-opensslextra
  347. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  348. - name: 'build wolfssl (opensslextra)'
  349. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true'
  350. run: |
  351. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  352. https://github.com/wolfSSL/wolfssl/archive/v${{ env.wolfssl-version }}-stable.tar.gz
  353. tar -xzf v${{ env.wolfssl-version }}-stable.tar.gz
  354. cd wolfssl-${{ env.wolfssl-version }}-stable
  355. ./autogen.sh
  356. ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --enable-opensslextra \
  357. --disable-benchmark --disable-crypttests --disable-examples --prefix=$HOME/wolfssl-opensslextra
  358. make install
  359. - name: 'cache mbedtls'
  360. if: contains(matrix.build.install_steps, 'mbedtls')
  361. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  362. id: cache-mbedtls
  363. env:
  364. cache-name: cache-mbedtls-threadsafe
  365. with:
  366. path: /home/runner/mbedtls
  367. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mbedtls-version }}
  368. - name: 'build mbedtls'
  369. if: contains(matrix.build.install_steps, 'mbedtls') && steps.cache-mbedtls.outputs.cache-hit != 'true'
  370. run: |
  371. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  372. https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-${{ env.mbedtls-version }}/mbedtls-${{ env.mbedtls-version }}.tar.bz2
  373. tar -xjf mbedtls-${{ env.mbedtls-version }}.tar.bz2
  374. cd mbedtls-${{ env.mbedtls-version }}
  375. ./scripts/config.py set MBEDTLS_THREADING_C
  376. ./scripts/config.py set MBEDTLS_THREADING_PTHREAD
  377. cmake -B . -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=$HOME/mbedtls \
  378. -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF
  379. cmake --build .
  380. cmake --install .
  381. - name: 'cache openssl (thread sanitizer)'
  382. if: contains(matrix.build.install_steps, 'openssl-tsan')
  383. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  384. id: cache-openssl-tsan
  385. env:
  386. cache-name: cache-openssl-tsan
  387. with:
  388. path: /home/runner/openssl
  389. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.openssl-version }}
  390. - name: 'build openssl (thread sanitizer)'
  391. if: contains(matrix.build.install_steps, 'openssl-tsan') && steps.cache-openssl-tsan.outputs.cache-hit != 'true'
  392. run: |
  393. git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/openssl/openssl
  394. cd openssl
  395. CC="clang" CFLAGS="-fsanitize=thread" LDFLAGS="-fsanitize=thread" ./config --prefix=$HOME/openssl --libdir=lib no-makedepend no-apps no-docs no-tests
  396. make
  397. make -j1 install_sw
  398. - name: 'cache quictls'
  399. if: contains(matrix.build.install_steps, 'quictls')
  400. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  401. id: cache-quictls
  402. env:
  403. cache-name: cache-quictls
  404. with:
  405. path: /home/runner/quictls
  406. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.quictls-version }}-quic1
  407. - name: 'build quictls'
  408. if: contains(matrix.build.install_steps, 'quictls') && steps.cache-quictls.outputs.cache-hit != 'true'
  409. run: |
  410. git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }}-quic1 https://github.com/quictls/openssl
  411. cd openssl
  412. ./config --prefix=$HOME/quictls --libdir=lib no-makedepend no-apps no-docs no-tests
  413. make
  414. make -j1 install_sw
  415. - name: 'cache msh3'
  416. if: contains(matrix.build.install_steps, 'msh3')
  417. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  418. id: cache-msh3
  419. env:
  420. cache-name: cache-msh3
  421. with:
  422. path: /home/runner/msh3
  423. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.msh3-version }}
  424. - name: 'build msh3'
  425. if: contains(matrix.build.install_steps, 'msh3') && steps.cache-msh3.outputs.cache-hit != 'true'
  426. run: |
  427. git clone --quiet --depth=1 -b v${{ env.msh3-version }} --recursive https://github.com/nibanks/msh3
  428. cd msh3
  429. cmake -B . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/msh3
  430. cmake --build .
  431. cmake --install .
  432. - name: 'cache awslc'
  433. if: contains(matrix.build.install_steps, 'awslc')
  434. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  435. id: cache-awslc
  436. env:
  437. cache-name: cache-awslc
  438. with:
  439. path: /home/runner/awslc
  440. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.awslc-version }}
  441. - name: 'build awslc'
  442. if: contains(matrix.build.install_steps, 'awslc') && steps.cache-awslc.outputs.cache-hit != 'true'
  443. run: |
  444. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 \
  445. https://github.com/awslabs/aws-lc/archive/refs/tags/v${{ env.awslc-version }}.tar.gz
  446. tar xzf v${{ env.awslc-version }}.tar.gz
  447. mkdir aws-lc-${{ env.awslc-version }}-build
  448. cd aws-lc-${{ env.awslc-version }}-build
  449. cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/awslc ../aws-lc-${{ env.awslc-version }} -DBUILD_TOOL=OFF -DBUILD_TESTING=OFF
  450. cmake --build .
  451. cmake --install .
  452. - name: 'cache rustls'
  453. if: contains(matrix.build.install_steps, 'rustls')
  454. uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
  455. id: cache-rustls
  456. env:
  457. cache-name: cache-rustls
  458. with:
  459. path: /home/runner/rustls
  460. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.rustls-version }}
  461. - name: 'install rust'
  462. if: contains(matrix.build.install_steps, 'rust') && steps.cache-rustls.outputs.cache-hit != 'true'
  463. run: |
  464. cd $HOME
  465. curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y
  466. source $HOME/.cargo/env
  467. rustup toolchain install nightly
  468. - name: 'build rustls'
  469. if: contains(matrix.build.install_steps, 'rustls') && steps.cache-rustls.outputs.cache-hit != 'true'
  470. run: |
  471. git clone --quiet --depth=1 -b v${{ env.rustls-version }} --recursive https://github.com/rustls/rustls-ffi.git
  472. cd rustls-ffi
  473. make DESTDIR=$HOME/rustls install
  474. - if: contains(matrix.build.install_steps, 'intel')
  475. run: |
  476. cd /tmp
  477. curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add -
  478. sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
  479. sudo apt install --no-install-recommends intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
  480. source /opt/intel/oneapi/setvars.sh
  481. printenv >> $GITHUB_ENV
  482. name: 'install Intel compilers'
  483. - run: autoreconf -fi
  484. if: ${{ matrix.build.configure }}
  485. name: 'autoreconf'
  486. - name: 'configure'
  487. run: |
  488. [[ '${{ matrix.build.install_steps }}' = *'awslc'* ]] && sudo apt remove --yes libssl-dev
  489. if [ -n '${{ matrix.build.PKG_CONFIG_PATH }}' ]; then
  490. export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
  491. fi
  492. if [ -n '${{ matrix.build.generate }}' ]; then
  493. cmake -B . -G Ninja \
  494. -DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
  495. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
  496. -DCURL_BROTLI=ON -DCURL_ZSTD=ON \
  497. ${{ matrix.build.generate }}
  498. else
  499. ${{ matrix.build.configure-prefix }} \
  500. ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  501. ${{ matrix.build.configure }}
  502. fi
  503. - name: 'configure log'
  504. if: ${{ !cancelled() }}
  505. run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
  506. - name: 'curl_config.h'
  507. run: |
  508. echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::'
  509. grep -F '#define' lib/curl_config.h | sort || true
  510. - name: 'test configs'
  511. run: |
  512. cat tests/config || true
  513. cat tests/http/config.ini || true
  514. - name: 'build'
  515. run: |
  516. if [ -n '${{ matrix.build.generate }}' ]; then
  517. ${{ matrix.build.make-prefix }} cmake --build . --verbose
  518. else
  519. ${{ matrix.build.make-prefix }} make V=1
  520. fi
  521. - name: 'single-use function check'
  522. if: ${{ contains(matrix.build.configure, '--disable-unity') || contains(matrix.build.generate, '-DCMAKE_UNITY_BUILD=OFF') }}
  523. run: |
  524. git config --global --add safe.directory "*"
  525. if [ -n '${{ matrix.build.generate }}' ]; then
  526. libcurla=lib/libcurl.a
  527. else
  528. libcurla=lib/.libs/libcurl.a
  529. fi
  530. ./scripts/singleuse.pl --unit ${libcurla}
  531. - run: ./src/curl -V
  532. name: 'check curl -V output'
  533. - run: cmake --install . --prefix $HOME/curl --strip
  534. if: ${{ matrix.build.generate }}
  535. name: 'cmake install'
  536. - name: 'build tests'
  537. if: ${{ matrix.build.install_steps != 'skipall' }}
  538. run: |
  539. if [ -n '${{ matrix.build.generate }}' ]; then
  540. cmake --build . --verbose --target testdeps
  541. else
  542. make V=1 -C tests
  543. fi
  544. - name: 'install test prereqs'
  545. if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.container == null }}
  546. run: |
  547. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  548. python3 -m pip install -r tests/requirements.txt
  549. - name: 'run tests'
  550. if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' }}
  551. timeout-minutes: ${{ contains(matrix.build.install_packages, 'valgrind') && 30 || 15 }}
  552. run: |
  553. export TFLAGS='${{ matrix.build.tflags }}'
  554. if [ -z '${{ matrix.build.torture }}' ]; then
  555. if [[ '${{ matrix.build.install_packages }}' = *'valgrind'* ]]; then
  556. TFLAGS+=' -j6'
  557. fi
  558. if [[ '${{ matrix.build.install_packages }}' = *'heimdal-dev'* ]]; then
  559. TFLAGS+=' ~2077 ~2078' # valgrind errors
  560. fi
  561. fi
  562. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  563. if [ -n '${{ matrix.build.generate }}' ]; then
  564. cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  565. else
  566. make V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  567. fi
  568. - name: 'install pytest prereqs'
  569. if: contains(matrix.build.install_steps, 'pytest')
  570. run: |
  571. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  572. python3 -m pip install -r tests/http/requirements.txt
  573. - name: 'run pytest'
  574. if: contains(matrix.build.install_steps, 'pytest')
  575. env:
  576. TFLAGS: "${{ matrix.build.tflags }}"
  577. CURL_CI: github
  578. run: |
  579. [ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
  580. if [ -n '${{ matrix.build.generate }}' ]; then
  581. cmake --build . --verbose --target curl-pytest-ci
  582. else
  583. make V=1 pytest-ci
  584. fi
  585. - name: 'build examples'
  586. run: |
  587. if [ -n '${{ matrix.build.generate }}' ]; then
  588. ${{ matrix.build.make-prefix }} cmake --build . --verbose --target curl-examples
  589. else
  590. ${{ matrix.build.make-prefix }} make V=1 examples
  591. fi