Skip to content

Release v1.0.6: fix CI flaky test, add CLI commands, Python binding #18

Release v1.0.6: fix CI flaky test, add CLI commands, Python binding

Release v1.0.6: fix CI flaky test, add CLI commands, Python binding #18

Workflow file for this run

name: CI Build & Test
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
build:
name: ${{ matrix.os }} / ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
compiler: [gcc, clang]
exclude:
- os: macos-latest
compiler: gcc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install GCC (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
run: |
sudo apt-get update
sudo apt-get install -y gcc g++
- name: Install Clang (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
run: |
sudo apt-get update
sudo apt-get install -y clang
- name: Set compiler (GCC)
if: matrix.compiler == 'gcc'
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
- name: Set compiler (Clang)
if: matrix.compiler == 'clang'
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Configure
run: cmake -B build -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
- name: Build (zero warnings required)
run: cmake --build build 2>&1 | tee build.log
- name: Verify zero warnings
run: |
if grep -iE "warning:" build.log | grep -v "In file included"; then
echo "::error::Build produced warnings — see above"
exit 1
fi
- name: Test
run: ctest --test-dir build --output-on-failure
lint:
name: clang-tidy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y clang clang-tidy
- name: Configure (with compile_commands.json)
run: |
cmake -B build \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF
- name: Build (needed for generated headers)
run: cmake --build build
- name: Run clang-tidy
run: |
find src -name '*.c' | xargs clang-tidy -p build --warnings-as-errors='*'
format-check:
name: clang-format check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check formatting
run: |
find include src wrapper/src wrapper/include -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.hpp' | \
xargs clang-format --dry-run --Werror
build-32bit:
name: Ubuntu / GCC / 32-bit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install 32-bit toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
- name: Configure (32-bit)
run: |
cmake -B build \
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=ON \
-DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure