Skip to content

Refactor CMake with JRL CMake Modules v2 #48

Refactor CMake with JRL CMake Modules v2

Refactor CMake with JRL CMake Modules v2 #48

Workflow file for this run

name: CI - Linux (APT)
on:
push:
branches:
- devel
pull_request:
paths-ignore:
- CHANGELOG.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: CI - ${{ matrix.os }} - ${{ matrix.build_type }} (APT)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
build_type: [Release, Debug]
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
steps:
- uses: actions/checkout@v6
- name: Setup ccache
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ matrix.os }}-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-${{ matrix.os }}-
- name: Update APT repositories
run: sudo apt-get update
- name: Install dependencies via APT
run: sudo apt-get install -y cmake ninja-build ccache graphviz libmatio-dev doxygen catch2 libeigen3-dev python3-numpy python3-dev python3-scipy
- name: Clear ccache stats
run: ccache --show-stats --zero-stats --verbose
- name: CMake Configure
run: /usr/bin/cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE=ON -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_DOCUMENTATION=ON -DBUILD_BENCHMARKS=ON
- name: CMake Build
run: /usr/bin/cmake --build build --verbose --parallel 2
- name: Show ccache stats
run: ccache --show-stats --verbose
- name: CTest
run: /usr/bin/ctest --test-dir build --output-on-failure
- name: CMake Install
run: /usr/bin/cmake --install build --prefix install
check:
if: always()
name: check-linux
needs:
- build_and_test
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}