Skip to content

Add Windows and macOS CI workflows #47

Add Windows and macOS CI workflows

Add Windows and macOS CI workflows #47

Workflow file for this run

name: C++ Core Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
cpp-build:
name: C++ Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
include:
- os: ubuntu-22.04
cc: gcc-11
cxx: g++-11
- os: ubuntu-24.04
cc: gcc-13
cxx: g++-13
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python (for build tools)
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc \
g++ \
build-essential \
libeigen3-dev \
python3-pip \
python3-dev \
cmake \
git \
ninja-build \
libflann-dev \
ccache \
libtbb-dev \
liblz4-dev \
${{ matrix.cxx }}
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-ccache-cpp-${{ matrix.os }}
restore-keys: ${{ runner.os }}-ccache-cpp
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Configure CMake
run: |
export CC=${{ matrix.cc }}
export CXX=${{ matrix.cxx }}
cmake -S cpp/kiss_matcher \
-B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DUSE_CCACHE=ON \
-DUSE_SYSTEM_EIGEN3=ON \
-DUSE_SYSTEM_TBB=ON \
-DUSE_SYSTEM_ROBIN=ON
- name: Build C++ Core
run: cmake --build build --config Release --parallel
- name: Run C++ Tests (if available)
run: |
if [ -d "build/tests" ] || [ -d "build/Release/tests" ]; then
ctest --test-dir build --output-on-failure --parallel
else
echo "No C++ tests found - skipping test execution"
fi
shell: bash
- name: Upload compile_commands.json
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: compile-commands
path: build/compile_commands.json
- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: cpp-build-${{ matrix.os }}
path: |
build/
!build/**/*.o
!build/**/*.obj
!build/**/CMakeFiles/