linux.yml 28 KB

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