• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2#
3# SPDX-License-Identifier: curl
4
5name: Linux
6
7on:
8  push:
9    branches:
10    - master
11    - '*/ci'
12    paths-ignore:
13    - '**/*.md'
14    - '.azure-pipelines.yml'
15    - '.circleci/**'
16    - '.cirrus.yml'
17    - 'appveyor.yml'
18    - 'packages/**'
19    - 'plan9/**'
20    - 'projects/**'
21    - 'winbuild/**'
22  pull_request:
23    branches:
24    - master
25    paths-ignore:
26    - '**/*.md'
27    - '.azure-pipelines.yml'
28    - '.circleci/**'
29    - '.cirrus.yml'
30    - 'appveyor.yml'
31    - 'packages/**'
32    - 'plan9/**'
33    - 'projects/**'
34    - 'winbuild/**'
35
36concurrency:
37  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
38  cancel-in-progress: true
39
40permissions: {}
41
42jobs:
43  autotools:
44    name: ${{ matrix.build.name }}
45    runs-on: 'ubuntu-latest'
46    container: ${{ matrix.build.container }}
47    timeout-minutes: 90
48    strategy:
49      fail-fast: false
50      matrix:
51        build:
52        - name: quiche
53          install_packages: zlib1g-dev
54          install_steps: quiche pytest
55          configure: LDFLAGS="-Wl,-rpath,/home/runner/work/curl/curl/quiche/target/release" --with-openssl=/home/runner/work/curl/curl/quiche/quiche/deps/boringssl/src --enable-debug --with-quiche=/home/runner/work/curl/curl/quiche/target/release
56
57        - name: bearssl
58          install_packages: zlib1g-dev
59          install_steps: bearssl pytest
60          configure: LDFLAGS="-Wl,-rpath,$HOME/bear/lib" --with-bearssl=$HOME/bear --enable-debug
61
62        - name: bearssl-clang
63          install_packages: zlib1g-dev clang
64          install_steps: bearssl
65          configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/bear/lib" --with-bearssl=$HOME/bear --enable-debug
66
67        - name: libressl
68          install_packages: zlib1g-dev
69          install_steps: libressl pytest
70          configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug
71
72        - name: libressl-clang
73          install_packages: zlib1g-dev clang
74          install_steps: libressl
75          configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug
76
77        - name: mbedtls
78          install_packages: libnghttp2-dev
79          install_steps: mbedtls pytest
80          configure: LDFLAGS="-Wl,-rpath,$HOME/mbed/lib" --with-mbedtls=$HOME/mbed --enable-debug
81
82        - name: mbedtls-clang
83          install_packages: libnghttp2-dev clang
84          install_steps: mbedtls
85          configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/mbed/lib" --with-mbedtls=$HOME/mbed --enable-debug
86
87        - name: msh3
88          install_packages: zlib1g-dev
89          install_steps: quictls msh3
90          configure: LDFLAGS="-Wl,-rpath,$HOME/msh3/lib -Wl,-rpath,$HOME/quictls/lib" --with-msh3=$HOME/msh3 --with-openssl=$HOME/quictls --enable-debug
91
92        - name: openssl3
93          install_packages: zlib1g-dev
94          install_steps: gcc-11 openssl3 pytest
95          configure: LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib64" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
96
97        - name: openssl3-O3
98          install_packages: zlib1g-dev
99          install_steps: gcc-11 openssl3
100          configure: CFLAGS=-O3 LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib64" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
101
102        - name: openssl3-clang
103          install_packages: zlib1g-dev clang
104          install_steps: openssl3
105          configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/openssl3/lib64" --with-openssl=$HOME/openssl3 --enable-debug --enable-websockets
106
107        - name: event-based
108          install_packages: libssh-dev
109          configure: --enable-debug --disable-shared --disable-threaded-resolver --with-libssh --with-openssl
110          tflags: -n -e '!TLS-SRP'
111
112        - name: hyper
113          install_steps: rust hyper
114          configure: LDFLAGS="-Wl,-rpath,$HOME/hyper/target/debug" --with-openssl --with-hyper=$HOME/hyper --enable-debug --enable-websockets
115
116        - name: rustls
117          install_steps: rust rustls pytest
118          configure: --with-rustls=$HOME/rustls --enable-debug
119
120        - name: Intel compiler - without SSL
121          install_packages: zlib1g-dev
122          install_steps: intel
123          configure: CC=icc --enable-debug --without-ssl
124
125        - name: Intel compiler - OpenSSL
126          install_packages: zlib1g-dev libssl-dev
127          install_steps: intel
128          configure: CC=icc --enable-debug --with-openssl
129
130        - name: NSS
131          install_packages: clang libnss3-dev libnghttp2-dev nss-plugin-pem
132          configure: CC=clang CPPFLAGS="-isystem /usr/include/nss" --with-nss --enable-debug --with-nss-deprecated
133
134        - name: Slackware-openssl-with-gssapi-gcc
135          # These are essentially the same flags used to build the curl Slackware package
136          # https://ftpmirror.infania.net/slackware/slackware64-current/source/n/curl/curl.SlackBuild
137          configure: --with-openssl --with-libssh2 --with-gssapi --enable-ares --enable-static=no --without-ca-bundle --with-ca-path=/etc/ssl/certs
138          # Docker Hub image that `container-job` executes in
139          container: 'andy5995/slackware-build-essential:15.0'
140
141    steps:
142    - if: ${{ matrix.build.container == null }}
143      run: |
144        sudo apt-get update
145        sudo apt-get install libtool autoconf automake pkg-config stunnel4 libpsl-dev libbrotli-dev libzstd-dev ${{ matrix.build.install_packages }}
146        sudo python3 -m pip install impacket
147      name: 'install prereqs and impacket'
148
149    - uses: actions/checkout@v3
150
151    - if: ${{ contains(matrix.build.install_steps, 'gcc-11') }}
152      run: |
153        sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
154        sudo apt-get update
155        sudo apt-get install gcc-11
156        sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
157        sudo update-alternatives --set gcc /usr/bin/gcc-11
158        gcc --version
159      name: 'install gcc-11'
160
161    - if: ${{ contains(matrix.build.install_steps, 'bearssl') }}
162      run: |
163        curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://bearssl.org/bearssl-0.6.tar.gz
164        tar -xzf bearssl-0.6.tar.gz
165        cd bearssl-0.6
166        make
167        mkdir -p $HOME/bear/lib $HOME/bear/include
168        cp inc/*.h $HOME/bear/include
169        cp build/libbearssl.* $HOME/bear/lib
170      name: 'install bearssl'
171
172    - if: ${{ contains(matrix.build.install_steps, 'libressl') }}
173      run: |
174        git clone --depth=1 -b v3.6.1 https://github.com/libressl-portable/portable.git libressl-git
175        cd libressl-git
176        ./autogen.sh
177        ./configure --prefix=$HOME/libressl
178        make install
179      name: 'install libressl'
180
181    - if: ${{ contains(matrix.build.install_steps, 'quiche') }}
182      run: |
183        git clone --depth=1 --recursive https://github.com/cloudflare/quiche.git
184        cd quiche
185        #### Work-around https://github.com/curl/curl/issues/7927 #######
186        #### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
187        sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml
188
189        # /home/runner/work/curl/curl/boringssl
190
191        cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog --verbose
192        mkdir -v quiche/deps/boringssl/src/lib
193        ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
194
195        # include dir
196        # /home/runner/work/curl/curl/quiche/quiche/deps/boringssl/src/include
197        # lib dir
198        # /home/runner/work/curl/curl/quiche/quiche/deps/boringssl/src/lib
199
200      name: 'build quiche and boringssl'
201
202    - if: ${{ contains(matrix.build.install_steps, 'mbedtls') }}
203      run: |
204        git clone --depth=1 -b v3.3.0 https://github.com/ARMmbed/mbedtls
205        cd mbedtls
206        make DESTDIR=$HOME/mbed install
207      name: 'install mbedtls'
208
209    - if: ${{ contains(matrix.build.install_steps, 'openssl3') }}
210      run: |
211        git clone --depth=1 https://github.com/openssl/openssl
212        cd openssl
213        ./config enable-tls1_3 --prefix=$HOME/openssl3
214        make install_sw
215      name: 'install openssl'
216
217    - if: ${{ contains(matrix.build.install_steps, 'quictls') }}
218      run: |
219        git clone --depth=1 -b OpenSSL_1_1_1t+quic https://github.com/quictls/openssl
220        cd openssl
221        ./config enable-tls1_3 --prefix=$HOME/quictls
222        make install_sw
223      name: 'install quictls'
224
225    - if: ${{ contains(matrix.build.install_steps, 'msh3') }}
226      run: |
227        git clone -b v0.6.0 --depth=1 --recursive https://github.com/nibanks/msh3
228        cd msh3 && mkdir build && cd build
229        cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/msh3 ..
230        cmake --build .
231        cmake --install .
232      name: 'install msh3'
233
234    - if: ${{ contains(matrix.build.install_steps, 'rust') }}
235      run: |
236        cd $HOME
237        curl -sSf --compressed https://sh.rustup.rs/ | sh -s -- -y
238        source $HOME/.cargo/env
239        rustup toolchain install nightly
240      name: 'install rust'
241
242    - if: ${{ contains(matrix.build.install_steps, 'rustls') }}
243      run: |
244        git clone --depth=1 -b v0.9.2 --recursive https://github.com/rustls/rustls-ffi.git
245        cd rustls-ffi
246        make DESTDIR=$HOME/rustls install
247      name: 'install rustls'
248
249    - if: ${{ contains(matrix.build.install_steps, 'hyper') }}
250      run: |
251        cd $HOME
252        git clone --depth=1 https://github.com/hyperium/hyper.git
253        cd $HOME/hyper
254        RUSTFLAGS="--cfg hyper_unstable_ffi" cargo +nightly rustc --features client,http1,http2,ffi -Z unstable-options --crate-type cdylib
255        echo "LD_LIBRARY_PATH=$HOME/hyper/target/debug:/usr/local/lib" >> $GITHUB_ENV
256      name: 'install hyper'
257
258    - if: ${{ contains(matrix.build.install_steps, 'intel') }}
259      run: |
260        cd /tmp
261        curl -sSf --compressed https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo apt-key add -
262        sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
263        sudo apt install --no-install-recommends intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
264        source /opt/intel/oneapi/setvars.sh
265        printenv >> $GITHUB_ENV
266      name: 'install Intel compilers'
267
268    - if: ${{ contains(matrix.build.install_steps, 'pytest') }}
269      run: |
270        sudo apt-get install apache2 apache2-dev libnghttp2-dev
271        sudo python3 -m pip install impacket pytest cryptography multipart
272        git clone --depth=1 -b master https://github.com/icing/mod_h2
273        cd mod_h2
274        autoreconf -fi
275        ./configure PKG_CONFIG_PATH="$HOME/all/lib/pkgconfig"
276        make
277        sudo make install
278      name: 'install pytest and apach2-dev mod-h2'
279
280    - run: autoreconf -fi
281      name: 'autoreconf'
282
283    - run: ./configure --enable-warnings --enable-werror ${{ matrix.build.configure }}
284      name: 'configure'
285
286    - run: make V=1
287      name: 'make'
288
289    - run: make V=1 examples
290      name: 'make examples'
291
292    - run: make V=1 -C tests
293      name: 'make tests'
294
295    - run: make V=1 test-ci
296      name: 'run tests'
297      env:
298        TFLAGS: "${{ matrix.build.tflags }}"
299
300    - if: ${{ contains(matrix.build.install_steps, 'pytest') }}
301      # run for `tests` directory, so pytest does not pick up any other
302      # packages we might have built here
303      run:
304        pytest tests
305      name: 'run pytest'
306      env:
307        TFLAGS: "${{ matrix.build.tflags }}"
308