Skip to content
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI
on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install "clang-format==21.*"
- run: clang-format --dry-run -Werror src/*.cpp src/*.hpp

build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [g++, clang++]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
cmake -B build \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="-Wall -Wextra"
- name: Build
run: cmake --build build -j

sanitizers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer: ["address,undefined", "thread"]
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}"
- name: Build
run: cmake --build build -j
- name: Smoke run
env:
ASAN_OPTIONS: detect_leaks=1:exitcode=42
UBSAN_OPTIONS: halt_on_error=1:exitcode=42
TSAN_OPTIONS: exitcode=42
run: |
timeout 30 ./build/unixboard < /dev/null > /dev/null || code=$?
if [ "${code:-0}" = 42 ]; then echo "sanitizer reported an error"; exit 1; fi
Loading