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=ARMmbed/mbedtls versioning=semver registryUrl=https://github.com
  40. mbedtls-version: 3.6.0
  41. # renovate: datasource=github-tags depName=icing/mod_h2 versioning=semver registryUrl=https://github.com
  42. mod_h2-version: 2.0.29
  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.34.2
  47. # handled in renovate.json
  48. openssl3-version: openssl-3.1.3
  49. # unhandled
  50. quictls-version: 3.1.4+quic
  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-latest'
  57. container: ${{ matrix.build.container }}
  58. timeout-minutes: 90
  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-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: msh3
  100. install_packages: zlib1g-dev
  101. install_steps: quictls msh3
  102. configure: LDFLAGS="-Wl,-rpath,$HOME/msh3/lib -Wl,-rpath,$HOME/quictls/lib" --with-msh3=$HOME/msh3 --with-openssl=$HOME/quictls --enable-debug
  103. - name: awslc
  104. install_packages: zlib1g-dev
  105. install_steps: awslc
  106. configure: LDFLAGS="-Wl,-rpath,$HOME/awslc/lib" --with-openssl=$HOME/awslc
  107. - name: awslc
  108. install_packages: zlib1g-dev
  109. install_steps: awslc
  110. generate: -DOPENSSL_ROOT_DIR=$HOME/awslc -DCMAKE_UNITY_BUILD=OFF
  111. - name: openssl default
  112. install_steps: pytest
  113. configure: --with-openssl --enable-debug --disable-unity
  114. - name: openssl libssh2 sync-resolver valgrind
  115. install_packages: zlib1g-dev libssh2-1-dev valgrind
  116. install_steps: pytest
  117. configure: --with-openssl --enable-debug --disable-threaded-resolver --with-libssh2
  118. - name: openssl3
  119. install_packages: zlib1g-dev
  120. install_steps: gcc-11 openssl3 pytest
  121. configure: CFLAGS=-std=gnu89 LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
  122. - name: openssl3 -O3 valgrind
  123. install_packages: zlib1g-dev valgrind
  124. install_steps: gcc-11 openssl3
  125. configure: CPPFLAGS=-DCURL_WARN_SIGN_CONVERSION CFLAGS=-O3 LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
  126. - name: openssl3 clang krb5
  127. install_packages: zlib1g-dev libkrb5-dev clang
  128. install_steps: openssl3
  129. configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --with-gssapi --enable-debug --enable-websockets
  130. - name: openssl3 clang krb5
  131. install_packages: zlib1g-dev libkrb5-dev clang
  132. install_steps: openssl3
  133. generate: -DOPENSSL_ROOT_DIR=$HOME/openssl3 -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DENABLE_WEBSOCKETS=ON
  134. - name: openssl3 !ipv6
  135. install_steps: gcc-11 openssl3
  136. configure: LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --disable-ipv6 --disable-unity
  137. - name: openssl3 https-only
  138. install_steps: gcc-11 openssl3
  139. configure: >
  140. LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib" --with-openssl=$HOME/openssl3 --enable-debug --disable-unity
  141. --disable-dict --disable-gopher --disable-ldap --disable-telnet
  142. --disable-imap --disable-pop3 --disable-smtp
  143. --disable-rtmp --disable-rtsp
  144. --disable-scp --disable-sftp --disable-tftp --disable-ftp --disable-file --disable-smb
  145. - name: '!ssl !http !smtp !imap'
  146. install_steps: gcc-11
  147. configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity
  148. - name: scanbuild
  149. install_packages: clang-tools clang libssl-dev libssh2-1-dev
  150. install_steps: skipall
  151. configure: --with-openssl --enable-debug --with-libssh2 --disable-unity
  152. configure-prefix: CC=clang scan-build
  153. make-prefix: scan-build --status-bugs
  154. - name: address-sanitizer
  155. install_packages: zlib1g-dev libssh2-1-dev clang libssl-dev libubsan1 libasan8 libtsan2
  156. install_steps: pytest
  157. configure: >
  158. CC=clang
  159. CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g"
  160. LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer"
  161. LIBS="-ldl -lubsan"
  162. --with-openssl --enable-debug --enable-websockets
  163. - name: thread-sanitizer
  164. install_packages: zlib1g-dev clang libtsan2
  165. install_steps: pytest openssltsan3
  166. configure: >
  167. CC=clang
  168. CFLAGS="-fsanitize=thread -g"
  169. LDFLAGS="-fsanitize=thread -Wl,-rpath,$HOME/openssl3/lib"
  170. --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
  171. - name: memory-sanitizer
  172. install_packages: clang
  173. configure: >
  174. CC=clang
  175. CFLAGS="-fsanitize=memory -Wformat -Werror=format-security -Werror=array-bounds -g"
  176. LDFLAGS="-fsanitize=memory"
  177. LIBS="-ldl"
  178. --without-ssl --without-zlib --without-brotli --without-zstd --without-libpsl --without-nghttp2 --enable-debug --enable-websockets
  179. - name: event-based
  180. install_packages: libssh-dev
  181. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl
  182. tflags: -n -e '!TLS-SRP'
  183. - name: hyper
  184. install_steps: rust hyper
  185. configure: LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" --with-openssl --with-hyper=$HOME/hyper --enable-debug --enable-websockets
  186. - name: rustls valgrind
  187. install_packages: libpsl-dev valgrind
  188. install_steps: rust rustls pytest
  189. configure: --with-rustls=$HOME/rustls --enable-debug
  190. - name: IntelC !SSL
  191. install_packages: zlib1g-dev
  192. install_steps: intel
  193. configure: CC=icc --enable-debug --without-ssl
  194. - name: IntelC openssl valgrind
  195. install_packages: zlib1g-dev libssl-dev valgrind
  196. install_steps: intel
  197. configure: CC=icc --enable-debug --with-openssl
  198. - name: Slackware openssl gssapi gcc
  199. # These are essentially the same flags used to build the curl Slackware package
  200. # https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild
  201. configure: --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs
  202. # Docker Hub image that `container-job` executes in
  203. container: 'andy5995/slackware-build-essential:15.0'
  204. - name: Alpine MUSL
  205. configure: --enable-debug --enable-websockets --with-ssl --with-libssh2 --with-libidn2 --with-gssapi --enable-ldap --with-libpsl
  206. container: 'alpine:3.18'
  207. steps:
  208. - if: matrix.build.container == null
  209. run: |
  210. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  211. sudo apt-get update -y
  212. sudo apt-get install libtool autoconf automake ninja-build pkgconf stunnel4 libpsl-dev libbrotli-dev libzstd-dev \
  213. ${{ matrix.build.install_packages }}
  214. sudo python3 -m pip install impacket
  215. name: 'install prereqs and impacket'
  216. - if: startsWith(matrix.build.container, 'alpine')
  217. run: |
  218. 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
  219. name: 'install dependencies'
  220. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
  221. - name: Fix kernel mmap rnd bits
  222. # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
  223. # high-entropy ASLR in much newer kernels that GitHub runners are
  224. # using leading to random crashes: https://reviews.llvm.org/D148280
  225. # See https://github.com/actions/runner-images/issues/9491
  226. continue-on-error: true
  227. run: sudo sysctl vm.mmap_rnd_bits=28
  228. - if: contains(matrix.build.install_steps, 'gcc-11')
  229. run: |
  230. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  231. sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
  232. sudo apt-get update
  233. sudo apt-get install gcc-11
  234. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
  235. sudo update-alternatives --set gcc /usr/bin/gcc-11
  236. gcc --version
  237. name: 'install gcc-11'
  238. - name: cache bearssl
  239. if: contains(matrix.build.install_steps, 'bearssl')
  240. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  241. id: cache-bearssl
  242. env:
  243. cache-name: cache-bearssl
  244. with:
  245. path: /home/runner/bearssl
  246. key: ${{ runner.os }}-build-${{ env.cache-name }}-bearssl-${{ env.bearssl-version }}
  247. - name: 'build bearssl'
  248. if: contains(matrix.build.install_steps, 'bearssl') && steps.cache-bearssl.outputs.cache-hit != 'true'
  249. run: |
  250. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://bearssl.org/bearssl-${{ env.bearssl-version }}.tar.gz
  251. tar -xzf bearssl-${{ env.bearssl-version }}.tar.gz
  252. cd bearssl-${{ env.bearssl-version }}
  253. make
  254. mkdir -p $HOME/bearssl/lib $HOME/bearssl/include
  255. cp inc/*.h $HOME/bearssl/include
  256. cp build/libbearssl.* $HOME/bearssl/lib
  257. - name: cache libressl
  258. if: contains(matrix.build.install_steps, 'libressl')
  259. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  260. id: cache-libressl
  261. env:
  262. cache-name: cache-libressl
  263. with:
  264. path: /home/runner/libressl
  265. key: ${{ runner.os }}-build-${{ env.cache-name }}-libressl-${{ env.libressl-version }}
  266. - name: 'build libressl'
  267. if: contains(matrix.build.install_steps, 'libressl') && steps.cache-libressl.outputs.cache-hit != 'true'
  268. run: |
  269. git clone --quiet --depth=1 -b v${{ env.libressl-version }} https://github.com/libressl-portable/portable.git libressl-git
  270. cd libressl-git
  271. ./autogen.sh
  272. ./configure --disable-dependency-tracking --prefix=$HOME/libressl
  273. make install
  274. - name: cache wolfssl (all)
  275. if: contains(matrix.build.install_steps, 'wolfssl-all')
  276. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  277. id: cache-wolfssl-all
  278. env:
  279. cache-name: cache-wolfssl-all
  280. with:
  281. path: /home/runner/wolfssl-all
  282. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.libressl-version }}
  283. - name: 'build wolfssl (all)'
  284. if: contains(matrix.build.install_steps, 'wolfssl-all') && steps.cache-wolfssl-all.outputs.cache-hit != 'true'
  285. run: |
  286. source .github/scripts/VERSIONS
  287. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz
  288. tar -xzf v$WOLFSSL_VER-stable.tar.gz
  289. cd wolfssl-$WOLFSSL_VER-stable
  290. ./autogen.sh
  291. ./configure --disable-dependency-tracking --enable-tls13 --enable-harden --prefix=$HOME/wolfssl-all --enable-all
  292. make install
  293. - name: cache wolfssl (opensslextra)
  294. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra')
  295. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  296. id: cache-wolfssl-opensslextra
  297. env:
  298. cache-name: cache-wolfssl-opensslextra
  299. with:
  300. path: /home/runner/wolfssl-opensslextra
  301. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.libressl-version }}
  302. - name: 'build wolfssl (opensslextra)'
  303. if: contains(matrix.build.install_steps, 'wolfssl-opensslextra') && steps.cache-wolfssl-opensslextra.outputs.cache-hit != 'true'
  304. run: |
  305. source .github/scripts/VERSIONS
  306. curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz
  307. tar -xzf v$WOLFSSL_VER-stable.tar.gz
  308. cd wolfssl-$WOLFSSL_VER-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 }}-mbedtls-${{ 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 }}-quictls-${{ 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 }}-msh3-${{ 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 }}-rustls-${{ 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