Skip to content

Adds Github Workflow #8

Adds Github Workflow

Adds Github Workflow #8

Workflow file for this run

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
build_type: [Release]
cpp_compiler: [gcc, clang++]
use_boost: ["ON", "OFF"]
#include:
# - os: ubuntu-latest
# c_compiler: gcc
# cpp_compiler: g++
# - os: ubuntu-latest
# c_compiler: clang
# cpp_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Install depdencies
run: |
sudo apt-get -y update
sudo apt-get -y install libboost-all-dev python3-dev
- name: Install pybind11
run: sudo pip install "pybind11[global]"
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DUSE_BOOST=${{ matrix.boost_defitinion }}
-S ${{ github.workspace }}
- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --build-config ${{ matrix.build_type }} --output-on-failure