Skip to content

Commit 25d8e0a

Browse files
authored
Merge pull request #36 from vargalabs/10-ci-add-sanitizers-and-coverage
[#10]:svarga:ci, add sanitizers and coverage
2 parents a771bc4 + 7ff86da commit 25d8e0a

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,52 @@ jobs:
310310
publish_dir: ./${{ steps.badge_dir.outputs.dir }}
311311
destination_dir: ${{ steps.badge_dir.outputs.dir }}
312312

313+
sanitizers:
314+
name: sanitizers / ubuntu-24.04 / clang-19
315+
runs-on: ubuntu-24.04
316+
317+
env:
318+
CC: clang-19
319+
CXX: clang++-19
320+
ASAN_OPTIONS: halt_on_error=1:detect_leaks=1
321+
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
322+
323+
steps:
324+
- name: Checkout
325+
uses: actions/checkout@v5
326+
with:
327+
fetch-depth: 0
328+
329+
- name: Install dependencies
330+
shell: bash
331+
run: |
332+
sudo apt-get update
333+
sudo apt-get install -y cmake ninja-build gcc-13 g++-13
334+
wget https://apt.llvm.org/llvm.sh
335+
chmod +x llvm.sh
336+
codename="$(. /etc/os-release && echo "$VERSION_CODENAME")"
337+
sudo DISTRIB_CODENAME="$codename" ./llvm.sh 19 all
338+
339+
- name: Configure
340+
shell: bash
341+
run: |
342+
gcc_root="$(dirname "$(dirname "$(readlink -f "$(command -v g++-13)")")")"
343+
cmake -S . -B build -G Ninja \
344+
-DCMAKE_BUILD_TYPE=Debug \
345+
-DCMAKE_C_COMPILER=clang-19 \
346+
-DCMAKE_CXX_COMPILER=clang++-19 \
347+
-DCMAKE_C_FLAGS="--gcc-toolchain=$gcc_root" \
348+
-DCMAKE_CXX_FLAGS="--gcc-toolchain=$gcc_root -stdlib=libstdc++" \
349+
-DCMAKE_EXE_LINKER_FLAGS="--gcc-toolchain=$gcc_root -stdlib=libstdc++"
350+
351+
- name: Build
352+
shell: bash
353+
run: cmake --build build --parallel
354+
355+
- name: Test (ASan + UBSan)
356+
shell: bash
357+
run: ctest --test-dir build --output-on-failure --parallel
358+
313359
coverage:
314360
name: coverage / ubuntu-24.04 / gcc-14
315361
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)