http3-linux.yml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: Linux HTTP/3
  5. 'on':
  6. push:
  7. branches:
  8. - master
  9. - '*/ci'
  10. paths-ignore:
  11. - '**/*.md'
  12. - '**/CMakeLists.txt'
  13. - '.circleci/**'
  14. - 'appveyor.*'
  15. - 'CMake/**'
  16. - 'packages/**'
  17. - 'plan9/**'
  18. - 'projects/**'
  19. - 'winbuild/**'
  20. pull_request:
  21. branches:
  22. - master
  23. paths-ignore:
  24. - '**/*.md'
  25. - '**/CMakeLists.txt'
  26. - '.circleci/**'
  27. - 'appveyor.*'
  28. - 'CMake/**'
  29. - 'packages/**'
  30. - 'plan9/**'
  31. - 'projects/**'
  32. - 'winbuild/**'
  33. concurrency:
  34. # Hardcoded workflow filename as workflow name above is just Linux again
  35. group: http3-${{ github.event.pull_request.number || github.sha }}
  36. cancel-in-progress: true
  37. permissions: {}
  38. env:
  39. MAKEFLAGS: -j 5
  40. # handled in renovate.json
  41. openssl3-version: openssl-3.3.0
  42. # unhandled
  43. quictls-version: 3.1.4+quic
  44. # renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com
  45. gnutls-version: 3.8.7
  46. wolfssl-version: master
  47. # renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
  48. nghttp3-version: 1.5.0
  49. # renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
  50. ngtcp2-version: 1.7.0
  51. # renovate: datasource=github-tags depName=nghttp2/nghttp2 versioning=semver registryUrl=https://github.com
  52. nghttp2-version: 1.62.1
  53. # renovate: datasource=github-tags depName=cloudflare/quiche versioning=semver registryUrl=https://github.com
  54. quiche-version: 0.22.0
  55. # renovate: datasource=github-tags depName=icing/mod_h2 versioning=semver registryUrl=https://github.com
  56. mod_h2-version: 2.0.29
  57. jobs:
  58. setup:
  59. runs-on: ubuntu-latest
  60. outputs:
  61. wolfssl-version: ${{ steps.wolfssl-version.outputs.result }}
  62. steps:
  63. - id: wolfssl-version
  64. uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
  65. with:
  66. result-encoding: string
  67. script: |
  68. let version = '${{ env.wolfssl-version }}'
  69. if (version != 'master') {
  70. return version
  71. }
  72. let { data: commits } = await github.rest.repos.listCommits({
  73. owner: 'wolfSSL',
  74. repo: 'wolfssl',
  75. })
  76. return commits[0].sha
  77. build-cache:
  78. needs:
  79. - setup
  80. runs-on: ubuntu-latest
  81. steps:
  82. - name: cache quictls
  83. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  84. id: cache-quictls-no-deprecated
  85. env:
  86. cache-name: cache-quictls-no-deprecated
  87. with:
  88. path: /home/runner/quictls/build
  89. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }}
  90. - name: cache gnutls
  91. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  92. id: cache-gnutls
  93. env:
  94. cache-name: cache-gnutls
  95. with:
  96. path: /home/runner/gnutls/build
  97. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.gnutls-version }}
  98. - name: cache wolfssl
  99. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  100. id: cache-wolfssl
  101. env:
  102. cache-name: cache-wolfssl
  103. wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
  104. with:
  105. path: /home/runner/wolfssl/build
  106. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  107. - name: cache nghttp3
  108. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  109. id: cache-nghttp3
  110. env:
  111. cache-name: cache-nghttp3
  112. with:
  113. path: /home/runner/nghttp3/build
  114. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp3-version }}
  115. - name: cache ngtcp2
  116. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  117. id: cache-ngtcp2
  118. env:
  119. cache-name: cache-ngtcp2
  120. with:
  121. path: /home/runner/ngtcp2/build
  122. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}
  123. - name: cache nghttp2
  124. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  125. id: cache-nghttp2
  126. env:
  127. cache-name: cache-nghttp2
  128. with:
  129. path: /home/runner/nghttp2/build
  130. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}
  131. - id: settings
  132. if: |
  133. steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true' ||
  134. steps.cache-gnutls.outputs.cache-hit != 'true' ||
  135. steps.cache-wolfssl.outputs.cache-hit != 'true' ||
  136. steps.cache-nghttp3.outputs.cache-hit != 'true' ||
  137. steps.cache-ngtcp2.outputs.cache-hit != 'true' ||
  138. steps.cache-nghttp2.outputs.cache-hit != 'true'
  139. run: |
  140. echo 'needs-build=true' >> $GITHUB_OUTPUT
  141. - name: install build prerequisites
  142. if: steps.settings.outputs.needs-build == 'true'
  143. run: |
  144. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  145. sudo apt-get update -y
  146. sudo apt-get install libtool autoconf automake pkgconf stunnel4 \
  147. libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
  148. nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
  149. libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
  150. texinfo texlive texlive-extra-utils autopoint libev-dev \
  151. apache2 apache2-dev libnghttp2-dev
  152. echo 'CC=gcc-12' >> $GITHUB_ENV
  153. echo 'CXX=g++-12' >> $GITHUB_ENV
  154. - if: steps.cache-quictls-no-deprecated.outputs.cache-hit != 'true'
  155. run: |
  156. cd $HOME
  157. git clone --quiet --depth=1 -b openssl-${{ env.quictls-version }} https://github.com/quictls/openssl quictls
  158. cd quictls
  159. ./config no-deprecated --prefix=$PWD/build --libdir=lib
  160. make
  161. make -j1 install_sw
  162. name: 'build quictls'
  163. - if: steps.cache-gnutls.outputs.cache-hit != 'true'
  164. run: |
  165. cd $HOME
  166. git clone --quiet --depth=1 -b ${{ env.gnutls-version }} https://github.com/gnutls/gnutls.git
  167. cd gnutls
  168. ./bootstrap
  169. ./configure --disable-dependency-tracking --prefix=$PWD/build \
  170. LDFLAGS="-Wl,-rpath,$PWD/build/lib -L$PWD/build/lib" \
  171. --with-included-libtasn1 --with-included-unistring \
  172. --disable-guile --disable-doc --disable-tests --disable-tools
  173. make
  174. make install
  175. name: 'build gnutls'
  176. - if: steps.cache-wolfssl.outputs.cache-hit != 'true'
  177. env:
  178. wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
  179. run: |
  180. cd $HOME
  181. mkdir wolfssl
  182. cd wolfssl
  183. git init
  184. git remote add origin https://github.com/wolfSSL/wolfssl.git
  185. git fetch origin --depth=1 ${{ env.wolfssl-version }}
  186. git checkout ${{ env.wolfssl-version }}
  187. ./autogen.sh
  188. ./configure --disable-dependency-tracking --enable-all --enable-quic --prefix=$PWD/build
  189. make
  190. make install
  191. name: 'build wolfssl'
  192. - if: steps.cache-nghttp3.outputs.cache-hit != 'true'
  193. run: |
  194. cd $HOME
  195. git clone --quiet --depth=1 -b v${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3
  196. cd nghttp3
  197. git submodule update --init
  198. autoreconf -fi
  199. ./configure --disable-dependency-tracking --prefix=$PWD/build PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig" --enable-lib-only
  200. make
  201. make install
  202. name: 'build nghttp3'
  203. - if: steps.cache-ngtcp2.outputs.cache-hit != 'true'
  204. run: |
  205. cd $HOME
  206. git clone --quiet --depth=1 -b v${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2
  207. cd ngtcp2
  208. autoreconf -fi
  209. ./configure --disable-dependency-tracking --prefix=$PWD/build \
  210. PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/gnutls/build/lib/pkgconfig:$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig" \
  211. --enable-lib-only --with-openssl --with-gnutls --with-wolfssl
  212. make install
  213. name: 'build ngtcp2'
  214. - if: steps.cache-nghttp2.outputs.cache-hit != 'true'
  215. run: |
  216. cd $HOME
  217. git clone --quiet --depth=1 -b v${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2
  218. cd nghttp2
  219. autoreconf -fi
  220. ./configure --disable-dependency-tracking --prefix=$PWD/build \
  221. PKG_CONFIG_PATH="$HOME/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig" \
  222. LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib" \
  223. --enable-http3
  224. make install
  225. name: 'build nghttp2'
  226. autotools:
  227. name: ${{ matrix.build.name }}
  228. needs:
  229. - setup
  230. - build-cache
  231. runs-on: 'ubuntu-latest'
  232. timeout-minutes: 60
  233. strategy:
  234. fail-fast: false
  235. matrix:
  236. build:
  237. - name: quictls
  238. configure: >-
  239. PKG_CONFIG_PATH="$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib"
  240. --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug --disable-ntlm
  241. --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
  242. --with-openssl=$HOME/quictls/build
  243. - name: gnutls
  244. configure: >-
  245. PKG_CONFIG_PATH="$HOME/gnutls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/gnutls/build/lib"
  246. --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
  247. --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
  248. --with-gnutls=$HOME/gnutls/build
  249. - name: wolfssl
  250. configure: >-
  251. PKG_CONFIG_PATH="$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig:$HOME/nghttp2/build/lib/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/wolfssl/build/lib"
  252. --with-ngtcp2=$HOME/ngtcp2/build --enable-warnings --enable-werror --enable-debug
  253. --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
  254. --with-wolfssl=$HOME/wolfssl/build
  255. - name: openssl-quic
  256. configure: >-
  257. PKG_CONFIG_PATH="$HOME/openssl3/build/lib64/pkgconfig" LDFLAGS="-Wl,-rpath,$HOME/openssl3/build/lib64"
  258. --enable-warnings --enable-werror --enable-debug --disable-ntlm
  259. --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
  260. --with-openssl=$HOME/openssl3/build --with-openssl-quic
  261. --with-nghttp3=$HOME/nghttp3/build
  262. - name: quiche
  263. configure: >-
  264. LDFLAGS="-Wl,-rpath,/home/runner/quiche/target/release"
  265. --with-openssl=/home/runner/quiche/quiche/deps/boringssl/src
  266. --enable-warnings --enable-werror --enable-debug
  267. --with-quiche=/home/runner/quiche/target/release
  268. --with-test-nghttpx="$HOME/nghttp2/build/bin/nghttpx"
  269. --with-ca-fallback
  270. steps:
  271. - run: |
  272. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  273. sudo apt-get update -y
  274. sudo apt-get install libtool autoconf automake pkgconf stunnel4 \
  275. libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev \
  276. nettle-dev libp11-kit-dev libtspi-dev libunistring-dev guile-2.2-dev libtasn1-bin \
  277. libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
  278. texinfo texlive texlive-extra-utils autopoint libev-dev \
  279. apache2 apache2-dev libnghttp2-dev vsftpd
  280. echo 'CC=gcc-12' >> $GITHUB_ENV
  281. echo 'CXX=g++-12' >> $GITHUB_ENV
  282. name: 'install prereqs and impacket, pytest, crypto, apache2'
  283. - name: cache quictls
  284. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  285. id: cache-quictls-no-deprecated
  286. env:
  287. cache-name: cache-quictls-no-deprecated
  288. with:
  289. path: /home/runner/quictls/build
  290. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.quictls-version }}
  291. fail-on-cache-miss: true
  292. - name: cache gnutls
  293. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  294. id: cache-gnutls
  295. env:
  296. cache-name: cache-gnutls
  297. with:
  298. path: /home/runner/gnutls/build
  299. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.gnutls-version }}
  300. fail-on-cache-miss: true
  301. - name: cache wolfssl
  302. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  303. id: cache-wolfssl
  304. env:
  305. cache-name: cache-wolfssl
  306. wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
  307. with:
  308. path: /home/runner/wolfssl/build
  309. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
  310. fail-on-cache-miss: true
  311. - name: cache nghttp3
  312. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  313. id: cache-nghttp3
  314. env:
  315. cache-name: cache-nghttp3
  316. with:
  317. path: /home/runner/nghttp3/build
  318. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp3-version }}
  319. fail-on-cache-miss: true
  320. - name: cache ngtcp2
  321. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  322. id: cache-ngtcp2
  323. env:
  324. cache-name: cache-ngtcp2
  325. with:
  326. path: /home/runner/ngtcp2/build
  327. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}
  328. fail-on-cache-miss: true
  329. - name: cache nghttp2
  330. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  331. id: cache-nghttp2
  332. env:
  333. cache-name: cache-nghttp2
  334. with:
  335. path: /home/runner/nghttp2/build
  336. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}
  337. fail-on-cache-miss: true
  338. - name: cache openssl3
  339. if: matrix.build.name == 'openssl-quic'
  340. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  341. id: cache-openssl3
  342. env:
  343. cache-name: cache-openssl3
  344. with:
  345. path: /home/runner/openssl3/build
  346. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.openssl3-version }}
  347. - name: 'install openssl3'
  348. if: matrix.build.name == 'openssl-quic' && steps.cache-openssl3.outputs.cache-hit != 'true'
  349. run: |
  350. git clone --quiet --depth=1 -b ${{ env.openssl3-version }} https://github.com/openssl/openssl
  351. cd openssl
  352. ./config --prefix=$HOME/openssl3/build
  353. make -j1 install_sw
  354. cat exporters/openssl.pc
  355. - name: cache quiche
  356. if: matrix.build.name == 'quiche'
  357. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  358. id: cache-quiche
  359. env:
  360. cache-name: cache-quiche
  361. with:
  362. path: /home/runner/quiche
  363. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-quiche-${{ env.quiche-version }}
  364. - if: matrix.build.name == 'quiche' && steps.cache-quiche.outputs.cache-hit != 'true'
  365. run: |
  366. cd $HOME
  367. git clone --quiet --depth=1 -b ${{ env.quiche-version }} --recursive https://github.com/cloudflare/quiche.git
  368. cd quiche
  369. #### Work-around https://github.com/curl/curl/issues/7927 #######
  370. #### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
  371. sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml
  372. cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
  373. ln -s libquiche.so target/release/libquiche.so.0
  374. mkdir -v quiche/deps/boringssl/src/lib
  375. ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
  376. # include dir
  377. # /home/runner/quiche/quiche/deps/boringssl/src/include
  378. # lib dir
  379. # /home/runner/quiche/quiche/deps/boringssl/src/lib
  380. name: 'build quiche and boringssl'
  381. - name: cache mod_h2
  382. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  383. id: cache-mod_h2
  384. env:
  385. cache-name: cache-mod_h2
  386. with:
  387. path: /home/runner/mod_h2
  388. key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.mod_h2-version }}
  389. - if: steps.cache-mod_h2.outputs.cache-hit != 'true'
  390. run: |
  391. cd $HOME
  392. git clone --quiet --depth=1 -b v${{ env.mod_h2-version }} https://github.com/icing/mod_h2
  393. cd mod_h2
  394. autoreconf -fi
  395. ./configure
  396. make
  397. name: 'build mod_h2'
  398. - run: |
  399. cd $HOME/mod_h2
  400. sudo make install
  401. name: 'install mod_h2'
  402. - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
  403. - run: |
  404. sudo python3 -m pip install -r tests/requirements.txt -r tests/http/requirements.txt
  405. name: 'install python test prereqs'
  406. - run: autoreconf -fi
  407. name: 'autoreconf'
  408. - run: ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles ${{ matrix.build.configure }}
  409. name: 'configure'
  410. - run: make V=1
  411. name: 'make'
  412. - run: make V=1 -C tests
  413. name: 'make tests'
  414. - run: make V=1 test-ci
  415. name: 'run tests'
  416. env:
  417. TFLAGS: "${{ matrix.build.tflags }}"
  418. - run: pytest -v tests/http
  419. name: 'run pytest'
  420. env:
  421. TFLAGS: "${{ matrix.build.tflags }}"
  422. CURL_CI: github
  423. - run: make V=1 examples
  424. name: 'make examples'