Skip to content

Merge pull request #57 from brokkoli71/51-fix-casing-and-add-docstrings #127

Merge pull request #57 from brokkoli71/51-fix-casing-and-add-docstrings

Merge pull request #57 from brokkoli71/51-fix-casing-and-add-docstrings #127

Workflow file for this run

name: C++ CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup build tools (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
- name: Setup build tools (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install cmake ninja gcc
echo "CC=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
# For Windows we rely on the preinstalled Visual Studio toolchain; no extra install step needed
- name: Configure CMake (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p build
cd build
cmake -S .. -B . -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Configure CMake (macOS)
if: matrix.os == 'macos-latest'
run: |
mkdir -p build
cd build
cmake -S .. -B . -G Ninja -DCMAKE_BUILD_TYPE=Release
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: |
cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Release
shell: pwsh
- name: Build (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cd build
ninja -v
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: |
cmake --build build --config Release -- /m
shell: pwsh
- name: Run tests (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
cd build
ctest --output-on-failure
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: |
cd build
ctest -C Release --output-on-failure
shell: pwsh
- name: Run Python tests (Linux/macOS)
if: matrix.os != 'windows-latest'
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd)/build
python test_bindings.py
- name: Run Python tests (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:PYTHONPATH = "$env:PYTHONPATH;$(Get-Location)\build\Release"
python test_bindings.py