Merge pull request #633 from laurynas-biveinis/parent-deps #9
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-ubuntu-20.04 | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
DEFAULT_SANITIZE_ADDRESS: OFF | |
DEFAULT_SANITIZE_THREAD: OFF | |
DEFAULT_SANITIZE_UB: OFF | |
permissions: {} | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
BUILD_TYPE: ${{matrix.BUILD_TYPE}} | |
COMPILER: ${{matrix.COMPILER}} | |
VERSION: ${{matrix.VERSION}} | |
SANITIZE_ADDRESS: ${{matrix.SANITIZE_ADDRESS}} | |
SANITIZE_THREAD: ${{matrix.SANITIZE_THREAD}} | |
SANITIZE_UB: ${{matrix.SANITIZE_UB}} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: clang 11 Release | |
BUILD_TYPE: Release | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Release with ASan | |
BUILD_TYPE: Release | |
SANITIZE_ADDRESS: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Release with TSan | |
BUILD_TYPE: Release | |
SANITIZE_THREAD: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Release with UBSan | |
BUILD_TYPE: Release | |
SANITIZE_UB: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Debug | |
BUILD_TYPE: Debug | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Debug with ASan | |
BUILD_TYPE: Debug | |
SANITIZE_ADDRESS: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Debug with TSan | |
BUILD_TYPE: Debug | |
SANITIZE_THREAD: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 11 Debug with UBSan | |
BUILD_TYPE: Debug | |
SANITIZE_UB: ON | |
COMPILER: clang | |
VERSION: 11 | |
- name: clang 12 Release | |
BUILD_TYPE: Release | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Release with ASan | |
BUILD_TYPE: Release | |
SANITIZE_ADDRESS: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Release with TSan | |
BUILD_TYPE: Release | |
SANITIZE_THREAD: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Release with UBSan | |
BUILD_TYPE: Release | |
SANITIZE_UB: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Debug | |
BUILD_TYPE: Debug | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Debug with ASan | |
BUILD_TYPE: Debug | |
SANITIZE_ADDRESS: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Debug with TSan | |
BUILD_TYPE: Debug | |
SANITIZE_THREAD: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: clang 12 Debug with UBSan | |
BUILD_TYPE: Debug | |
SANITIZE_UB: ON | |
COMPILER: clang | |
VERSION: 12 | |
- name: GCC 10 Release | |
BUILD_TYPE: Release | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Release with ASan | |
BUILD_TYPE: Release | |
SANITIZE_ADDRESS: ON | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Release with TSan | |
BUILD_TYPE: Release | |
SANITIZE_THREAD: ON | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Release with UBSan | |
BUILD_TYPE: Release | |
SANITIZE_UB: ON | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Debug | |
BUILD_TYPE: Debug | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Debug with ASan | |
BUILD_TYPE: Debug | |
SANITIZE_ADDRESS: ON | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Debug with TSan | |
BUILD_TYPE: Debug | |
SANITIZE_THREAD: ON | |
COMPILER: gcc | |
VERSION: 10 | |
- name: GCC 10 Debug with UBSan | |
BUILD_TYPE: Debug | |
SANITIZE_UB: ON | |
COMPILER: gcc | |
VERSION: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup common dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libboost-dev libc6-dev-i386 | |
- name: Setup dependencies for GCC | |
run: | | |
sudo apt-get install -y "gcc-${VERSION}" "gcc-${VERSION}-multilib" | |
if: env.COMPILER == 'gcc' | |
- name: Setup dependencies for LLVM (common) | |
run: | | |
sudo apt-get install -y "clang-${VERSION}" "clang-tidy-${VERSION}" | |
if: env.COMPILER == 'clang' | |
- name: Setup dependencies for LLVM (Release) | |
run: | | |
sudo apt-get install -y "libomp5-${VERSION}" "llvm-${VERSION}" \ | |
"lld-${VERSION}" | |
if: env.COMPILER == 'clang' && env.BUILD_TYPE == 'Release' | |
- name: Configure CMake | |
# Use a bash shell so we can use the same syntax for environment | |
# variable access regardless of the host operating system | |
shell: bash | |
run: | | |
SANITIZE_ADDRESS="${SANITIZE_ADDRESS:-$DEFAULT_SANITIZE_ADDRESS}" | |
SANITIZE_THREAD="${SANITIZE_THREAD:-$DEFAULT_SANITIZE_THREAD}" | |
SANITIZE_UB="${SANITIZE_UB:-$DEFAULT_SANITIZE_UB}" | |
if [[ $COMPILER == "gcc" ]]; then | |
export CC="gcc-${VERSION}" | |
export CXX="g++-${VERSION}" | |
EXTRA_CMAKE_ARGS=("-DMAINTAINER_MODE=ON") | |
else | |
export CC="clang-${VERSION}" | |
export CXX="clang++-${VERSION}" | |
EXTRA_CMAKE_ARGS=("-DCLANG_TIDY_EXE=/usr/bin/clang-tidy-${VERSION}") | |
if [[ $BUILD_TYPE == "Release" ]]; then | |
EXTRA_CMAKE_ARGS=("${EXTRA_CMAKE_ARGS[@]}" \ | |
"-DLLVMAR_EXECUTABLE=/usr/bin/llvm-ar-${VERSION}" \ | |
"-DLLVMNM_EXECUTABLE=/usr/bin/llvm-nm-${VERSION}" \ | |
"-DLLVMRANLIB_EXECUTABLE=/usr/bin/llvm-ranlib-${VERSION}") | |
fi | |
fi | |
cmake -B build "$GITHUB_WORKSPACE" -DSTANDALONE=ON \ | |
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \ | |
"-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}" \ | |
"-DSANITIZE_THREAD=${SANITIZE_THREAD}" \ | |
"-DSANITIZE_UB=${SANITIZE_UB}" "${EXTRA_CMAKE_ARGS[@]}" | |
- name: Build | |
working-directory: ${{github.workspace}}/build | |
run: make -j3 -k | |
- name: Correctness test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -j3 -V | |
- name: Benchmark correctness test | |
working-directory: ${{github.workspace}}/build | |
run: make -k quick_benchmarks |