Skip to content

Commit b481282

Browse files
committed
[INFRA] Add Sanitizer
1 parent 01c6bac commit b481282

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

Diff for: .github/workflows/ci_sanitizer.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Sanitizer
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * SAT"
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: sanitizer-actions
10+
cancel-in-progress: true
11+
12+
env:
13+
TZ: Europe/Berlin
14+
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1
15+
TSAN_OPTIONS: ignore_noninstrumented_modules=1
16+
UBSAN_OPTIONS: print_stacktrace=1
17+
18+
defaults:
19+
run:
20+
shell: bash -Eeuxo pipefail {0}
21+
22+
jobs:
23+
build:
24+
name: ${{ matrix.name }} ${{ matrix.build_type }} ${{ matrix.os }}
25+
runs-on: ${{ matrix.os }}
26+
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
name: [ASan, TSan, UBSan]
31+
os: [ubuntu-latest, macos-12]
32+
build_type: [Release, RelWithDebInfo, Debug]
33+
exclude:
34+
- name: "TSan"
35+
os: macos-12
36+
include:
37+
- name: "ASan"
38+
os: ubuntu-latest
39+
cxx_flags: "-fno-omit-frame-pointer -fsanitize=address -Wno-maybe-uninitialized -Wno-interference-size"
40+
41+
- name: "ASan"
42+
os: macos-12
43+
cxx_flags: "-fno-omit-frame-pointer -fsanitize=address"
44+
45+
- name: "TSan"
46+
cxx_flags: "-fno-omit-frame-pointer -fsanitize=thread"
47+
48+
- name: "UBSan"
49+
os: ubuntu-latest
50+
cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero -Wno-interference-size"
51+
52+
- name: "UBSan"
53+
os: macos-12
54+
cxx_flags: "-fno-omit-frame-pointer -fsanitize=undefined,float-divide-by-zero,local-bounds,nullability -fno-sanitize=function -Wno-pass-failed"
55+
56+
- os: macos-12
57+
compiler: clang-18
58+
59+
- os: ubuntu-latest
60+
compiler: gcc-14
61+
image: ghcr.io/seqan/gcc-14
62+
63+
- name: "TSan"
64+
os: ubuntu-latest
65+
compiler: clang-18
66+
image: ghcr.io/seqan/clang-18
67+
container:
68+
image: ${{ matrix.image || '' }}
69+
volumes:
70+
- /home/runner:/home/runner
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Setup compiler
76+
if: contains(matrix.os, 'macos')
77+
uses: seqan/actions/setup-compiler@main
78+
with:
79+
compiler: ${{ matrix.compiler }}
80+
81+
- name: Configure tests
82+
run: |
83+
mkdir build && cd build
84+
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
85+
-DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}"
86+
make gtest_main
87+
88+
- name: Build tests
89+
working-directory: build
90+
run: make -k api_test cli_test display_layout measure_hyperloglog
91+
92+
- name: Run tests
93+
working-directory: build
94+
run: ctest . -j --output-on-failure
95+

0 commit comments

Comments
 (0)