xref: /curl/.github/workflows/quiche-linux.yml (revision 303bb878)
1# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2#
3# SPDX-License-Identifier: curl
4
5name: quiche
6
7on:
8  push:
9    branches:
10      - master
11      - '*/ci'
12    paths-ignore:
13      - '**/*.md'
14      - '**/CMakeLists.txt'
15      - '.azure-pipelines.yml'
16      - '.circleci/**'
17      - '.cirrus.yml'
18      - 'appveyor.*'
19      - 'CMake/**'
20      - 'packages/**'
21      - 'plan9/**'
22      - 'projects/**'
23      - 'winbuild/**'
24  pull_request:
25    branches:
26      - master
27    paths-ignore:
28      - '**/*.md'
29      - '**/CMakeLists.txt'
30      - '.azure-pipelines.yml'
31      - '.circleci/**'
32      - '.cirrus.yml'
33      - 'appveyor.*'
34      - 'CMake/**'
35      - 'packages/**'
36      - 'plan9/**'
37      - 'projects/**'
38      - 'winbuild/**'
39
40concurrency:
41  # Hardcoded workflow filename as workflow name above is just Linux again
42  group: quiche-${{ github.event.pull_request.number || github.sha }}
43  cancel-in-progress: true
44
45permissions: {}
46
47env:
48  MAKEFLAGS: -j 3
49  openssl-version: 3.1.4+quic
50  nghttp3-version: v1.2.0
51  ngtcp2-version: v1.4.0
52  nghttp2-version: v1.61.0
53  quiche-version: 0.20.0
54  mod_h2-version: v2.0.27
55
56jobs:
57  autotools:
58    name: ${{ matrix.build.name }}
59    runs-on: 'ubuntu-latest'
60    timeout-minutes: 60
61    strategy:
62      fail-fast: false
63      matrix:
64        build:
65          - name: quiche
66            install: >-
67              libpsl-dev libbrotli-dev libzstd-dev zlib1g-dev libev-dev libc-ares-dev
68            install_steps: pytest
69            configure: >-
70              LDFLAGS="-Wl,-rpath,/home/runner/quiche/target/release"
71              --with-openssl=/home/runner/quiche/quiche/deps/boringssl/src
72              --enable-debug
73              --with-quiche=/home/runner/quiche/target/release
74              --with-test-nghttpx="$HOME/nghttpx/bin/nghttpx"
75              --with-ca-fallback
76
77    steps:
78      - run: |
79          sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
80          sudo apt-get update
81          sudo apt-get install libtool autoconf automake pkg-config stunnel4 ${{ matrix.build.install }}
82          sudo apt-get install apache2 apache2-dev libnghttp2-dev
83        name: 'install prereqs and impacket, pytest, crypto'
84
85      - name: cache nghttpx
86        uses: actions/cache@v4
87        id: cache-nghttpx
88        env:
89          cache-name: cache-nghttpx
90        with:
91          path: /home/runner/nghttpx
92          key: ${{ runner.os }}-build-${{ env.cache-name }}-openssl-${{ env.openssl-version }}-nghttp3-${{ env.nghttp3-version }}-ngtcp2-${{ env.ngtcp2-version }}-nghttp2-${{ env.nghttp2-version }}
93
94      - if: steps.cache-nghttpx.outputs.cache-hit != 'true'
95        run: |
96          git clone --quiet --depth=1 -b openssl-${{ env.openssl-version }} https://github.com/quictls/openssl
97          cd openssl
98          ./config --prefix=$HOME/nghttpx --libdir=$HOME/nghttpx/lib
99          make -j1 install_sw
100        name: 'install quictls'
101
102      - if: steps.cache-nghttpx.outputs.cache-hit != 'true'
103        run: |
104          git clone --quiet --depth=1 -b ${{ env.nghttp3-version }} https://github.com/ngtcp2/nghttp3
105          cd nghttp3
106          git submodule update --init
107          autoreconf -fi
108          ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only
109          make install
110        name: 'install nghttp3'
111
112      - if: steps.cache-nghttpx.outputs.cache-hit != 'true'
113        run: |
114          git clone --quiet --depth=1 -b ${{ env.ngtcp2-version }} https://github.com/ngtcp2/ngtcp2
115          cd ngtcp2
116          autoreconf -fi
117          ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-lib-only --with-openssl
118          make install
119        name: 'install ngtcp2'
120
121      - if: steps.cache-nghttpx.outputs.cache-hit != 'true'
122        run: |
123          git clone --quiet --depth=1 -b ${{ env.nghttp2-version }} https://github.com/nghttp2/nghttp2
124          cd nghttp2
125          autoreconf -fi
126          ./configure --prefix=$HOME/nghttpx PKG_CONFIG_PATH="$HOME/nghttpx/lib/pkgconfig" --enable-http3
127          make install
128        name: 'install nghttp2'
129
130      - name: cache quiche
131        uses: actions/cache@v4
132        id: cache-quiche
133        env:
134          cache-name: cache-quiche
135        with:
136          path: /home/runner/quiche
137          key: ${{ runner.os }}-build-${{ env.cache-name }}-quiche-${{ env.quiche-version }}
138
139      - if: steps.cache-quiche.outputs.cache-hit != 'true'
140        run: |
141          cd $HOME
142          git clone --quiet --depth=1 -b ${{ env.quiche-version }} --recursive https://github.com/cloudflare/quiche.git
143          cd quiche
144          #### Work-around https://github.com/curl/curl/issues/7927 #######
145          #### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
146          sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml
147
148          cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
149          mkdir -v quiche/deps/boringssl/src/lib
150          ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
151
152          # include dir
153          # /home/runner/quiche/quiche/deps/boringssl/src/include
154          # lib dir
155          # /home/runner/quiche/quiche/deps/boringssl/src/lib
156        name: 'build quiche and boringssl'
157
158      - name: cache mod_h2
159        uses: actions/cache@v4
160        id: cache-mod_h2
161        env:
162          cache-name: cache-mod_h2
163        with:
164          path: /home/runner/mod_h2
165          key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.mod_h2-version }}
166
167      - if: steps.cache-mod_h2.outputs.cache-hit != 'true'
168        run: |
169          cd $HOME
170          git clone --quiet --depth=1 -b  ${{ env.mod_h2-version }} https://github.com/icing/mod_h2
171          cd mod_h2
172          autoreconf -fi
173          ./configure
174          make
175        name: 'build mod_h2'
176
177      - run: |
178          cd $HOME/mod_h2
179          sudo make install
180        name: 'install mod_h2'
181
182      - uses: actions/checkout@v4
183
184      - run: |
185          sudo python3 -m pip install -r tests/requirements.txt -r tests/http/requirements.txt
186        name: 'install python test prereqs'
187
188      - run: autoreconf -fi
189        name: 'autoreconf'
190
191      - run: ./configure ${{ matrix.build.configure }}
192        name: 'configure'
193
194      - run: make V=1
195        name: 'make'
196
197      - run: make V=1 examples
198        name: 'make examples'
199
200      - run: make V=1 -C tests
201        name: 'make tests'
202
203      - run: make V=1 test-ci
204        name: 'run tests'
205        env:
206          TFLAGS: "${{ matrix.build.tflags }}"
207
208      - run: pytest -v tests
209        name: 'run pytest'
210        env:
211          TFLAGS: "${{ matrix.build.tflags }}"
212          CURL_CI: github
213