Skip to content

Upgrade libraries and compiler #199

Upgrade libraries and compiler

Upgrade libraries and compiler #199

Workflow file for this run

---
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Formatting
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
build-linux:
strategy:
fail-fast: false
matrix:
target: [x86_64-w64-mingw32, x86_64-linux]
sanitizers: [ON, OFF]
newdbm: [ON, OFF]
exclude:
- target: x86_64-w64-mingw32
sanitizers: ON
runs-on: ubuntu-latest
env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/toolchain/${{ matrix.target }}.cmake
CMAKE_BUILD_TYPE: Release
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_TEST_TIMEOUT: 20
STATIC: OFF
steps:
- uses: actions/checkout@v3
- name: Install MinGW64 cross-compiler and wine
if: matrix.target == 'x86_64-w64-mingw32'
run: |
sudo apt-get -qqy update
sudo apt-get -qqy install cmake make g++-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-tools wine wine-binfmt
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
WINEPATH=$($PWD/winepath-for ${{ matrix.target }})
echo "WINEPATH=$WINEPATH" >> $GITHUB_ENV
echo "WINARCH=win64" >> $GITHUB_ENV
# - name: Build without getlibs
# run: |
# BUILD="build-${{ matrix.target }}-${CMAKE_BUILD_TYPE,,}"
# cmake -B "$BUILD" -DUDBM_STATIC=$STATIC -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }} -DENABLE_DBM_NEW=${{ matrix.newdbm }}
# cmake --build "$BUILD" --config $CMAKE_BUILD_TYPE
# ctest --build "$BUILD" -C $CMAKE_BUILD_TYPE)
- name: Getlibs
run: ./getlibs.sh ${{ matrix.target }}
- name: Build with getlibs
run: |
BUILD="build-${{ matrix.target }}-libs-${CMAKE_BUILD_TYPE,,}"
cmake -B "$BUILD" -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/${{ matrix.target }}" -DUDBM_STATIC=$STATIC -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }} -DENABLE_DBM_NEW=${{ matrix.newdbm }}
cmake --build "$BUILD" --config $CMAKE_BUILD_TYPE
ctest --test-dir "$BUILD" -C $CMAKE_BUILD_TYPE
build-darwin:
runs-on: macos-latest
env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/toolchain/darwin.cmake
CMAKE_BUILD_TYPE: Release
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_TEST_TIMEOUT: 20
STATIC: ON
strategy:
fail-fast: false
matrix:
sanitizers: [ON, OFF]
steps:
- uses: actions/checkout@v3
# - name: Build without getlibs
# run: |
# BUILD=build-darwin-$CMAKE_BUILD_TYPE
# cmake -B "$BUILD" -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }}
# cmake --build "$BUILD" --config $CMAKE_BUILD_TYPE
# ctest --test-dir "$BUILD" -C $CMAKE_BUILD_TYPE
- name: Get dependencies
run: CMAKE_BUILD_TYPE=Release ./getlibs.sh darwin
- name: Build with getlibs
run: |
BUILD=build-darwin-libs-$CMAKE_BUILD_TYPE
cmake -B "$BUILD" -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/darwin" -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }}
cmake --build "$BUILD" --config $CMAKE_BUILD_TYPE
ctest --test-dir "$BUILD" -C $CMAKE_BUILD_TYPE
build-windows:
runs-on: windows-latest
env:
CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
CMAKE_BUILD_TYPE: Release
STATIC: ON
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_TEST_TIMEOUT: 20
steps:
- uses: actions/checkout@v3
# - name: Build without getlibs
# run: |
# $env:BUILD='build-x86_64-windows'
# cmake -B $env:BUILD
# cmake --build $env:BUILD --config $env:CMAKE_BUILD_TYPE
# ctest --test-dir $env:BUILD -C $env:CMAKE_BUILD_TYPE
- name: Get dependencies
run: |
vcpkg integrate install
vcpkg install doctest --triplet x64-windows
pwsh -Command { $env:CMAKE_BUILD_TYPE=Release ; bash ./getlibs.sh x86_64-w64-mingw32 }
- name: Build with getlibs
run: |
$env:BUILD='build-x86_64-windows-libs'
cmake -B $env:BUILD -DCMAKE_PREFIX_PATH="${{ github.workspace }}/local/x86_64-w64-mingw32"
cmake --build $env:BUILD --config $env:CMAKE_BUILD_TYPE
ctest --test-dir $env:BUILD -C $env:CMAKE_BUILD_TYPE