linux.yml 29 KB

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