Add address sanitizer to CI #908
Workflow file for this run
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
# | |
# Copyright (c) 2021-present, Trail of Bits, Inc. | |
# All rights reserved. | |
# | |
# This source code is licensed in accordance with the terms specified in | |
# the LICENSE file found in the root directory of this source tree. | |
# | |
name: Build | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
llvm-version: [17] | |
image-version: [22.04] | |
build-type: [rel, deb] | |
sanitizers: [ON, OFF] | |
runs-on: ubuntu-${{ matrix.image-version }} | |
timeout-minutes: 60 | |
container: | |
image: | |
ghcr.io/trailofbits/vast-ubuntu-${{ matrix.image-version }}-llvm-${{ matrix.llvm-version }}-dev:latest | |
env: | |
CMAKE_PREFIX_PATH: "/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/mlir/;/usr/lib/llvm-${{ matrix.llvm-version }}/lib/cmake/clang/" | |
TOOLCHAIN: ${{ github.workspace }}/cmake/lld.toolchain.cmake | |
LLVM_EXTERNAL_LIT: "/usr/local/bin/lit" | |
steps: | |
- name: Clone the VAST repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 1 | |
- name: Configure sanitizer build | |
if: ${{ matrix.sanitizers == 'ON' }} | |
run: | | |
cmake --preset ninja-multi-default --toolchain ${TOOLCHAIN} \ | |
-DCMAKE_VERBOSE_MAKEFILE=True \ | |
-DENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON \ | |
-DENABLE_SANITIZER_ADDRESS=ON \ | |
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} \ | |
-DLLVM_EXTERNAL_LIT=${LLVM_EXTERNAL_LIT} | |
- name: Configure build | |
if: ${{ matrix.sanitizers == 'OFF' }} | |
run: | | |
cmake --preset ninja-multi-default --toolchain ${TOOLCHAIN} \ | |
-DCMAKE_VERBOSE_MAKEFILE=True \ | |
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} \ | |
-DLLVM_EXTERNAL_LIT=${LLVM_EXTERNAL_LIT} | |
- name: Build ${{ matrix.build-type }} | |
run: | | |
cmake --build --preset ninja-${{ matrix.build-type }} -j $(nproc) | |
- name: Test ${{ matrix.build-type }} | |
run: ctest --preset ninja-${{ matrix.build-type }} --output-on-failure |