2
0

linux.yml 29 KB

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