Skip to content

Getting prepared for the new version of Cadmium #56

Getting prepared for the new version of Cadmium

Getting prepared for the new version of Cadmium #56

Workflow file for this run

name: CMake-Test
on:
push:
branches: [ "main", "devel" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
BOOST_PATH: ${{github.workspace}}/boost/boost
BOOST_VERSION: 1.73.0
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
steps:
# Checkout repository and submodules
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
# Retrieve the cache, uses cache@v2
- name: Cache boost
uses: actions/cache@v2
id: cache-boost
with:
# Set the default path as the path to cache
path: ${{env.BOOST_PATH}}
# Use the version as the key to only cache the correct version
key: boost-${{env.BOOST_VERSION}}
# Actual install step (only runs if the cache is empty)
- name: Install boost
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: MarkusJx/[email protected]
id: install-boost
with:
platform_version: 20.04
boost_version: ${{env.BOOST_VERSION}}
# boost_install_dir: ${{env.BOOST_PATH}}
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}\
-DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}/include\
-DBoost_LIBRARY_DIRS=${{steps.install-boost.outputs.BOOST_ROOT}}/lib
env:
BOOST_ROOT: ${{env.BOOST_PATH}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}