Skip to content

ci, add ASan and UBSan jobs with separate badges #14

@steven-varga

Description

@steven-varga

Summary

Add two separate CI jobs — one for AddressSanitizer, one for UndefinedBehaviorSanitizer — each emitting its own badge. Split as two jobs so README and staging-build-matrix.md can show independent pass/fail status.

Scope

Workflow

  • Add asan job to .github/workflows/ci.yml:
    • runs-on: ubuntu-24.04, CMAKE_BUILD_TYPE=Debug
    • Compiler: clang-20 (matches matrix top-end)
    • Flags: -fsanitize=address -fno-omit-frame-pointer -O1 -g
    • ASAN_OPTIONS=detect_leaks=1:halt_on_error=1:abort_on_error=1:strict_string_checks=1
    • Runs ctest --output-on-failure. Failure → red.
  • Add ubsan job to .github/workflows/ci.yml:
    • Same runner / compiler / build type.
    • Flags: -fsanitize=undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer -O1 -g
    • UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
    • Runs ctest --output-on-failure.
  • Each job emits its own badge JSON artifact (status-asan.json / status-ubsan.json), consumed by the existing generate-badges job.
  • Reuse LLVM toolchain cache from issue ci, align CI matrix with h5cpp staging and replace HDF5 dep with LLVM toolchain #12's setup.

Badges

  • Add [![ASan][asan-badge]] and [![UBSan][ubsan-badge]] rows to the top badge bar in README.md. Point at badges/asan.svg and badges/ubsan.svg.
  • Add same badges to staging-build-matrix.md pointing at badges-staging/asan.svg and badges-staging/ubsan.svg.
  • Update generate-badges job to also emit the two sanitizer SVGs into the badge output dir.

Acceptance criteria

  • Two new jobs visible in Actions UI on every push.
  • Two distinct badges in README badge bar.
  • Two distinct badges in staging-build-matrix.md badge bar.
  • Failing ASan or UBSan run flips the corresponding badge to red.

Dependencies

Conventions

  • Branch: cut from staging, named <N>-ci-add-asan-and-ubsan-jobs.
  • Commits: [#<N>]:svarga:ci, <description>.
  • PR: targets staging, title [#<N>]:svarga:ci, add ASan and UBSan jobs with separate badges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions