nghttp2/.github/workflows/build.yml

144 lines
4.7 KiB
YAML
Raw Normal View History

2020-11-16 09:48:31 +01:00
name: build
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
2020-12-29 10:33:50 +01:00
os: [ubuntu-20.04, macos-10.15]
2020-11-16 09:48:31 +01:00
compiler: [gcc, clang]
buildtool: [autotools, cmake]
2021-08-22 14:31:16 +02:00
http3: [http3, no-http3]
2020-11-16 09:48:31 +01:00
steps:
- uses: actions/checkout@v2
- name: Linux setup
if: runner.os == 'Linux'
run: |
sudo apt-get install \
g++-8 \
clang-10 \
autoconf \
automake \
autotools-dev \
libtool \
pkg-config \
zlib1g-dev \
libcunit1-dev \
libssl-dev \
libxml2-dev \
libev-dev \
libevent-dev \
libjansson-dev \
libjemalloc-dev \
libc-ares-dev \
cmake \
cmake-data
2021-01-17 09:41:01 +01:00
echo 'CPPFLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined -g' >> $GITHUB_ENV
echo 'LDFLAGS=-fsanitize=address,undefined -fno-sanitize-recover=undefined' >> $GITHUB_ENV
2020-11-16 09:48:31 +01:00
- name: MacOS setup
if: runner.os == 'macOS'
run: |
brew install \
libev \
libevent \
c-ares \
cunit \
libressl \
autoconf \
automake \
pkg-config \
libtool
echo 'PKG_CONFIG_PATH=/usr/local/opt/libressl/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig' >> $GITHUB_ENV
# This fixes infamous 'stdio.h not found' error.
echo 'SDKROOT='"$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- name: Setup clang (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'clang'
run: |
echo 'CC=clang-10' >> $GITHUB_ENV
echo 'CXX=clang++-10' >> $GITHUB_ENV
- name: Setup clang (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'clang'
run: |
echo 'CC=clang' >> $GITHUB_ENV
echo 'CXX=clang++' >> $GITHUB_ENV
- name: Setup gcc (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc-8' >> $GITHUB_ENV
echo 'CXX=g++-8' >> $GITHUB_ENV
- name: Setup gcc (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc' >> $GITHUB_ENV
echo 'CXX=g++' >> $GITHUB_ENV
2021-08-22 14:31:16 +02:00
- name: Build quictls/openssl
if: matrix.http3 == 'http3'
run: |
2021-08-26 14:41:06 +02:00
git clone --depth 1 -b OpenSSL_1_1_1l+quic https://github.com/quictls/openssl
2021-08-22 14:31:16 +02:00
cd openssl
./config enable-tls1_3 --prefix=$PWD/build
make -j$(nproc)
make install_sw
- name: Build nghttp3
if: matrix.http3 == 'http3'
run: |
git clone https://github.com/ngtcp2/nghttp3
cd nghttp3
autoreconf -i
./configure --prefix=$PWD/build --enable-lib-only
make -j$(nproc) check
make install
- name: Build ngtcp2
if: matrix.http3 == 'http3'
run: |
git clone https://github.com/ngtcp2/ngtcp2
cd ngtcp2
autoreconf -i
./configure --prefix=$PWD/build --enable-lib-only PKG_CONFIG_PATH="../openssl/build/lib/pkgconfig"
make -j$(nproc) check
make install
- name: Setup extra environment variables for HTTP/3
if: matrix.http3 == 'http3'
run: |
PKG_CONFIG_PATH="$PWD/openssl/build/lib/pkgconfig:$PWD/nghttp3/build/lib/pkgconfig:$PWD/ngtcp2/build/lib/pkgconfig:$PKG_CONFIG_PATH"
LDFLAGS="$LDFLAGS -Wl,-rpath,$PWD/openssl/build/lib"
EXTRA_AUTOTOOLS_OPTS="--enable-http3"
2021-08-22 14:31:16 +02:00
echo 'PKG_CONFIG_PATH='"$PKG_CONFIG_PATH" >> $GITHUB_ENV
echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV
echo 'EXTRA_AUTOTOOLS_OPTS='"$EXTRA_AUTOTOOLS_OPTS" >> $GITHUB_ENV
2021-08-22 16:31:43 +02:00
echo 'EXTRA_CMAKE_OPTS=-DENABLE_HTTP3=ON' >> $GITHUB_ENV
2020-11-16 09:48:31 +01:00
- name: Setup git submodules
run: |
git submodule update --init
- name: Configure autotools
if: matrix.buildtool == 'autotools'
run: |
autoreconf -i
2021-08-22 14:31:16 +02:00
./configure --enable-werror --with-mruby $EXTRA_AUTOTOOLS_OPTS
2020-11-16 09:48:31 +01:00
- name: Configure cmake
if: matrix.buildtool == 'cmake'
run: |
2021-08-22 16:31:43 +02:00
cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1 $EXTRA_CMAKE_OPTS -DCPPFLAGS="$CPPFLAGS" -DLDFLAGS="$LDFLAGS" .
2020-11-16 09:48:31 +01:00
- name: Build nghttp2 with autotools
if: matrix.buildtool == 'autotools'
run: |
make distcheck \
2021-08-22 14:31:16 +02:00
DISTCHECK_CONFIGURE_FLAGS="--with-mruby --with-neverbleed --enable-werror $EXTRA_AUTOTOOLS_OPTS CPPFLAGS=\"$CPPFLAGS\" LDFLAGS=\"$LDFLAGS\""
2020-11-16 09:48:31 +01:00
- name: Build nghttp2 with cmake
if: matrix.buildtool == 'cmake'
run: |
make
make check
- name: Integration test
# Integration tests for nghttpx; autotools erases build
# artifacts.
if: matrix.buildtool == 'cmake'
run: |
cd integration-tests
make itprep it