|
| 1 | +# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin |
| 2 | +# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik |
| 3 | +# SPDX-License-Identifier: CC0-1.0 |
| 4 | + |
| 5 | +name: Sanitizer |
| 6 | + |
| 7 | +on: |
| 8 | + schedule: |
| 9 | + - cron: "0 4 * * SAT" |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: sanitizer-actions |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +env: |
| 17 | + TZ: Europe/Berlin |
| 18 | + TSAN_OPTIONS: ignore_noninstrumented_modules=1 |
| 19 | + UBSAN_OPTIONS: print_stacktrace=1 |
| 20 | + |
| 21 | +defaults: |
| 22 | + run: |
| 23 | + shell: bash -Eeuxo pipefail {0} |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }} |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' |
| 30 | + env: |
| 31 | + 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' }} |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + name: [ASan, TSan, UBSan] |
| 36 | + os: [ubuntu-latest, macos-latest] |
| 37 | + build_type: [Release, RelWithDebInfo, Debug] |
| 38 | + exclude: |
| 39 | + - name: "TSan" |
| 40 | + os: macos-latest |
| 41 | + |
| 42 | + include: |
| 43 | + - name: "ASan" |
| 44 | + cxx_flags: "-fno-omit-frame-pointer -fsanitize=address" |
| 45 | + |
| 46 | + - name: "TSan" |
| 47 | + cxx_flags: "-fno-omit-frame-pointer -fsanitize=thread" |
| 48 | + |
| 49 | + - name: "UBSan" |
| 50 | + os: macos-latest |
| 51 | + cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero,implicit-conversion,local-bounds,nullability -Wno-pass-failed" |
| 52 | + |
| 53 | + - name: "UBSan" |
| 54 | + os: macos-latest |
| 55 | + build_type: Release |
| 56 | + ctest_excludes: "-E tmp_directory_snippet_cmp_output" |
| 57 | + |
| 58 | + - name: "UBSan" |
| 59 | + os: macos-latest |
| 60 | + build_type: RelWithDebInfo |
| 61 | + ctest_excludes: "-E tmp_directory_snippet_cmp_output" |
| 62 | + |
| 63 | + - name: "UBSan" |
| 64 | + os: ubuntu-latest |
| 65 | + cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero" |
| 66 | + |
| 67 | + - os: macos-latest |
| 68 | + compiler: clang-latest |
| 69 | + |
| 70 | + - os: ubuntu-latest |
| 71 | + compiler: gcc-latest |
| 72 | + image: ghcr.io/seqan/gcc-latest |
| 73 | + |
| 74 | + - name: "TSan" |
| 75 | + os: ubuntu-latest |
| 76 | + compiler: clang-latest |
| 77 | + image: ghcr.io/seqan/clang-latest |
| 78 | + container: |
| 79 | + image: ${{ matrix.image || '' }} |
| 80 | + steps: |
| 81 | + - name: Checkout |
| 82 | + uses: actions/checkout@v4 |
| 83 | + |
| 84 | + - name: Setup compiler |
| 85 | + if: contains(matrix.os, 'macos') |
| 86 | + uses: seqan/actions/setup-compiler@main |
| 87 | + with: |
| 88 | + compiler: ${{ matrix.compiler }} |
| 89 | + |
| 90 | + - name: Configure tests |
| 91 | + run: | |
| 92 | + mkdir build && cd build |
| 93 | + cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 94 | + -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" |
| 95 | + make gtest_main |
| 96 | +
|
| 97 | + - name: Build and run tests |
| 98 | + working-directory: build |
| 99 | + run: make -k check |
0 commit comments