Merge pull request #40 from ngtcp2/bump-munit #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
permissions: read-all | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-11] | |
compiler: [gcc, clang] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Linux setup | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install \ | |
g++-12 \ | |
clang-14 \ | |
autoconf \ | |
automake \ | |
autotools-dev \ | |
libtool \ | |
pkg-config | |
- name: MacOS setup | |
if: runner.os == 'macOS' | |
run: | | |
brew install autoconf automake pkg-config libtool | |
- name: Setup clang (Linux) | |
if: runner.os == 'Linux' && matrix.compiler == 'clang' | |
run: | | |
echo 'CC=clang-14' >> $GITHUB_ENV | |
echo 'CXX=clang++-14' >> $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-12' >> $GITHUB_ENV | |
echo 'CXX=g++-12' >> $GITHUB_ENV | |
- name: Setup gcc (MacOS) | |
if: runner.os == 'macOS' && matrix.compiler == 'gcc' | |
run: | | |
echo 'CC=gcc' >> $GITHUB_ENV | |
echo 'CXX=g++' >> $GITHUB_ENV | |
- name: Enable ASAN | |
if: runner.os == 'Linux' | |
run: | | |
asanflags="-fsanitize=address,undefined -fno-sanitize-recover=undefined" | |
LDFLAGS="$LDFLAGS $asanflags" | |
CFLAGS="$CFLAGS $asanflags -g3" | |
CXXFLAGS="$CXXFLAGS $asanflags -g3" | |
echo 'LDFLAGS='"$LDFLAGS" >> $GITHUB_ENV | |
echo 'CFLAGS='"$CFLAGS" >> $GITHUB_ENV | |
echo 'CXXFLAGS='"$CXXFLAGS" >> $GITHUB_ENV | |
- name: Configure autotools | |
run: | | |
git submodule update --init --depth 1 | |
autoreconf -i && ./configure | |
- name: Build sfparse with distcheck | |
run: | | |
make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-werror" | |
build-cross: | |
strategy: | |
matrix: | |
host: [x86_64-w64-mingw32, i686-w64-mingw32] | |
runs-on: ubuntu-22.04 | |
env: | |
HOST: ${{ matrix.host }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Linux setup | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install \ | |
gcc-mingw-w64 \ | |
autoconf \ | |
automake \ | |
autotools-dev \ | |
libtool \ | |
pkg-config \ | |
wine | |
- name: Configure autotools | |
run: | | |
git submodule update --init --depth 1 | |
autoreconf -i && \ | |
./configure --enable-werror \ | |
--host="$HOST" LIBS="-pthread" | |
- name: Build sfparse | |
run: | | |
make -j$(nproc) | |
make -j$(nproc) check TESTS="" | |
- name: Run tests | |
if: matrix.host == 'x86_64-w64-mingw32' | |
run: | | |
export WINEPATH=/usr/x86_64-w64-mingw32/lib | |
wine test.exe |