Skip to content

Add benchmark chart generator + light/dark PNGs #21

Add benchmark chart generator + light/dark PNGs

Add benchmark chart generator + light/dark PNGs #21

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
llvm_version: [21, 22]
sanitizer: [none, asan-ubsan]
env:
LLVM_VERSION: ${{ matrix.llvm_version }}
steps:
- uses: actions/checkout@v4
- name: Install build prerequisites
run: sudo apt-get update -qq && sudo apt-get install -y -qq ninja-build
- name: Install LLVM/Clang ${{ matrix.llvm_version }}
run: |
wget -q https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh "${LLVM_VERSION}" all
# Debug (not Release) for the sanitized leg: Release defines NDEBUG,
# which silently disables assert() -- a real bug this project
# shipped for a while (see docs/architecture.md's "Mutation
# testing" section) was only ever visible under a Debug build, not
# under ASan/UBSan specifically. Running Debug continuously in CI
# catches that whole class of bug going forward, not just the one
# instance that got found by accident.
- name: Configure (sanitized)
if: matrix.sanitizer == 'asan-ubsan'
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-${LLVM_VERSION} \
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
- name: Configure
if: matrix.sanitizer == 'none'
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-${LLVM_VERSION} \
-DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \
-DCMAKE_C_COMPILER=clang-${LLVM_VERSION}
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Test
run: ctest --test-dir build --output-on-failure
# Only needs to run once, not once per matrix leg -- the source
# doesn't change across LLVM versions/sanitizer settings, so this
# is gated to a single leg rather than duplicated four times.
- name: clang-format check
if: matrix.llvm_version == 22 && matrix.sanitizer == 'none'
run: |
find include lib tools tests/unit tests/support \
-regex '.*\.\(h\|cpp\)' \
| xargs clang-format-${LLVM_VERSION} --dry-run --Werror