Skip to content

Update library dependencies #171

Update library dependencies

Update library dependencies #171

Workflow file for this run

name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Format
run: find src include test -iregex '.*\.\(c\|h\|cpp\|hpp\|cc\|hh\|cxx\|hxx\)$' | xargs clang-format -n -Werror
build-linux-win:
strategy:
fail-fast: false
matrix:
target: [mingw, ubuntu]
sanitizers: [ON, OFF]
newdbm: [ON, OFF]
exclude:
- target: mingw
sanitizers: ON
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set default environment variables
run: echo "STATIC=OFF" >> "$GITHUB_ENV"
- name: Set mingw environment variables
if: matrix.target == 'mingw'
run: |
echo "CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/x86_64-w64-mingw32.cmake" >> "$GITHUB_ENV"
echo "STATIC=ON" >> "$GITHUB_ENV"
- name: Get ubuntu dependencies
if: matrix.target == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev doctest-dev
- name: Get mingw dependencies
if: matrix.target == 'mingw'
run: |
sudo apt-get update
sudo apt-get 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
- name: Getlibs
run: ./getlibs.sh
- name: Build and test
run: |
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DUDBM_WITH_TESTS=ON -DUDBM_STATIC=$STATIC -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }} -DCMAKE_BUILD_TYPE=Release -DENABLE_DBM_NEW=${{ matrix.newdbm }} -DCMAKE_PREFIX_PATH=$(pwd)/local -B build -S .
cmake --build build
(cd build ; ctest)
build-win-native:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Get dependencies
run: |
vcpkg integrate install
vcpkg install doctest --triplet x64-windows
bash ./getlibs.sh
- name: Build and test
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DUDBM_WITH_TESTS=ON "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_PREFIX_PATH=$PWD/local/x86_64-w64-mingw32 -B build -S .
cmake --build build --config Release
(cd build ; ctest --output-on-failure -C Release)
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
sanitizers: [ON, OFF]
steps:
- uses: actions/checkout@v2
- name: Get dependencies
run: brew install boost doctest && ./getlibs.sh
- name: Build and test
run: |
export CTEST_OUTPUT_ON_FAILURE=1
cmake -DUDBM_WITH_TESTS=ON -DASAN=${{ matrix.sanitizers }} -DUBSAN=${{ matrix.sanitizers }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$(pwd)/local -B build -S .
cmake --build build
(cd build ; ctest)
build-nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build and test
run: nix build -L
build-nix-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build and test
run: nix build -L
build-nix-cross:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build and test
run: nix build -L .\#packages.crossPackage.x86_64-linux