Skip to content
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
27 changes: 27 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

- name: Build
run: cmake --build build --config ${{ matrix.build_type }}

- name: Run tests
run: cd build && ctest -C ${{ matrix.build_type }} --output-on-failure
38 changes: 38 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Code Formatting

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
format:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v5

# Install clang-format if needed
- name: Install clang-format (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y clang-format

- name: Install clang-format (macOS)
if: matrix.os == 'macos-latest'
run: brew install clang-format || true

# Check formatting
- name: Check C/C++ formatting
run: |
misformatted=$(find . -name '*.c' -o -name '*.h' -print0 | xargs -0 clang-format -style=file -output-replacements-xml | grep "<replacement " || true)
if [ -n "$misformatted" ]; then
echo "ERROR: Some files are not properly formatted. Run clang-format -i."
exit 1
else
echo "All files are properly formatted."
exit 0
fi
33 changes: 33 additions & 0 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ASan+UBSan

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v5

# Configure CMake with ASan + UBSan
- name: Configure with sanitizers
run: cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
-DBUILD_TESTING=ON

# Build
- name: Build
run: cmake --build build --config Debug

# Run tests
- name: Run tests under ASan+UBSan
run: cd build && ctest --output-on-failure
26 changes: 26 additions & 0 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Valgrind

on: [push, pull_request]

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y valgrind

- name: Configure Debug build
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON

- name: Build
run: cmake --build build --config Debug

- name: Run tests under Valgrind
run: |
valgrind --leak-check=full --show-leak-kinds=all \
--track-origins=yes --show-reachable=yes \
--error-exitcode=1 build/bin/all_tests
Loading