Skip to content

Add undefined sanitizer to CI #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ubuntu-undef.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Ubuntu 22.04 (GCC 12 SANITIZED)

on: [push, pull_request]

permissions:
contents: read

jobs:
ubuntu-build:
if: >-
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
! contains(toJSON(github.event.commits.*.message), '[skip github]')
runs-on: ubuntu-22.04
strategy:
matrix:
shared: [ON, OFF]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Setup Ninja
run: sudo apt-get install ninja-build
- name: Prepare
run: cmake -D ADA_SANITIZE_UNDEFINED=ON -DADA_DEVELOPMENT_CHECKS=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} -G Ninja -B build
env:
CXX: g++-12
- name: Build
run: cmake --build build -j=2
- name: Test
run: ctest --output-on-failure --test-dir build
1 change: 1 addition & 0 deletions cmake/add-cpp-test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function(add_cpp_test TEST_NAME)
endif()
if(ADA_SANITIZE_UNDEFINED)
add_compile_options(-fsanitize=undefined -fno-sanitize-recover=all)
add_link_options(-fsanitize=undefined)
endif()
# Add the compile target
if (ARGS_LIBRARY)
Expand Down