Sanitizer #57
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
# SPDX-FileCopyrightText: 2006-2023, Knut Reinert & Freie Universität Berlin | |
# SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik | |
# SPDX-License-Identifier: CC0-1.0 | |
name: Sanitizer | |
on: | |
schedule: | |
- cron: "0 4 * * SAT" | |
workflow_dispatch: | |
concurrency: | |
group: sanitizer-actions | |
cancel-in-progress: true | |
env: | |
TZ: Europe/Berlin | |
TSAN_OPTIONS: ignore_noninstrumented_modules=1 | |
UBSAN_OPTIONS: print_stacktrace=1 | |
defaults: | |
run: | |
shell: bash -Eeuxo pipefail {0} | |
jobs: | |
build: | |
name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' | |
env: | |
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=${{ contains(matrix.os, 'macos') && '0' || '1' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [ASan, TSan, UBSan] | |
os: [ubuntu-latest, macos-14] | |
build_type: [Release, RelWithDebInfo, Debug] | |
exclude: | |
- name: "TSan" | |
os: macos-14 | |
include: | |
- name: "ASan" | |
cxx_flags: "-fno-omit-frame-pointer -fsanitize=address" | |
- name: "TSan" | |
cxx_flags: "-fno-omit-frame-pointer -fsanitize=thread" | |
- name: "UBSan" | |
os: macos-14 | |
cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero,implicit-conversion,local-bounds,nullability -Wno-pass-failed" | |
- name: "UBSan" | |
os: macos-14 | |
build_type: Release | |
ctest_excludes: "-E tmp_directory_snippet_cmp_output" | |
- name: "UBSan" | |
os: macos-14 | |
build_type: RelWithDebInfo | |
ctest_excludes: "-E tmp_directory_snippet_cmp_output" | |
- name: "UBSan" | |
os: ubuntu-latest | |
cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero" | |
- os: macos-14 | |
compiler: clang-19 | |
- os: ubuntu-latest | |
compiler: gcc-14 | |
image: ghcr.io/seqan/gcc-14 | |
- name: "TSan" | |
os: ubuntu-latest | |
compiler: clang-19 | |
image: ghcr.io/seqan/clang-19 | |
container: | |
image: ${{ matrix.image || '' }} | |
volumes: | |
- /home/runner:/home/runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup compiler | |
if: contains(matrix.os, 'macos') | |
uses: seqan/actions/setup-compiler@main | |
with: | |
compiler: ${{ matrix.compiler }} | |
- name: Patch M1 GCC | |
if: contains(matrix.os, 'macos') && contains(matrix.compiler, 'gcc') && matrix.compiler != 'gcc-14' | |
uses: seqan/actions/patch-m1-gcc@main | |
with: | |
compiler: ${{ matrix.compiler }} | |
- name: Configure tests | |
run: | | |
mkdir build && cd build | |
cmake ../test/all -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" | |
make -j gtest_main benchmark_main | |
- name: Build tests | |
working-directory: build | |
run: make -k -j | |
- name: Run tests | |
working-directory: build | |
run: ctest . -j --output-on-failure ${{ matrix.ctest_excludes }} | |