Skip to content

Refactor CMake with JRL CMake Modules v2 #649

Refactor CMake with JRL CMake Modules v2

Refactor CMake with JRL CMake Modules v2 #649

name: CI - Pixi - MacOS/Linux/Windows
on:
push:
branches:
- devel
paths-ignore:
- .gitlab-ci.yml
- .gitignore
- '**.md'
- CITATION.*
- LICENSE
- colcon.pkg
- .pre-commit-config.yaml
pull_request:
paths-ignore:
- .gitlab-ci.yml
- .gitignore
- '**.md'
- CITATION.*
- LICENSE
- colcon.pkg
- .pre-commit-config.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coal-pixi:
name: Pixi - ${{ matrix.os }} - Env ${{ matrix.environment }} - ${{ matrix.build_type }} ${{ matrix.cxx_options }}
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: ${{ github.workspace}}
CCACHE_DIR: ${{ github.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
# Since pixi will install a compiler, the compiler mtime will be changed.
# This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
CCACHE_COMPILERCHECK: content
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-26, macos-15-intel, windows-2022]
environment: [default, all, all-python-oldest, all-boost-python, all-clang, all-tracy]
build_type: [Release, Debug]
include:
# Define the variable for CMAKE_CXX_FLAGS
- cxx_options: ''
- run_tests: true
# Disable tests for tracy builds.
# FIXME: the coal-test-frontlist might crash on the CI
# Event with the TRACY_NO_INVARIANT_CHECK=1 env var set.
- environment: all-tracy
run_tests: false
# Test the legacy clang-cl compiler on Windows
- os: windows-2022
environment: all-clang-cl
# Enable builds with AVX2 optimizations
- os: ubuntu-22.04
environment: all
build_type: Release
cxx_options: '-mavx2'
- os: ubuntu-24.04
environment: all
build_type: Release
cxx_options: '-mavx2'
- os: macos-15-intel
environment: all
build_type: Release
cxx_options: '-mavx2'
exclude:
# Do not run Debug tests with Tracy to reduce CI load
- build_type: Debug
environment: all-tracy
# Disable Debug builds on windows
- os: windows-2022
build_type: Debug
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-coal-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}-${{ matrix.cxx_options }}-${{ github.sha }}
restore-keys: ccache-coal-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.environment }}-${{ matrix.cxx_options }}-
- uses: prefix-dev/setup-pixi@v0.9.3
with:
cache: true
environments: ${{ matrix.environment }}
- name: Clear ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -svz
- name: Build Coal [MacOS/Linux/Windows]
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
COAL_BUILD_TYPE: ${{ matrix.build_type }}
COAL_CXX_FLAGS: ${{ matrix.cxx_options }}
run: |
pixi run -e ${{ matrix.environment }} build
- name: Install Coal [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} install
- name: Test Coal [MacOS/Linux/Windows]
if: matrix.run_tests == true
run: |
pixi run -e ${{ matrix.environment }} test
- name: Show ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -sv
coal-python-standalone-pixi:
name: Python standalone - ${{ matrix.os }} - Env ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: ${{ github.workspace}}
CCACHE_DIR: ${{ github.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
# Since pixi will install a compiler, the compiler mtime will be changed.
# This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
CCACHE_COMPILERCHECK: content
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest]
environment: [all, all-boost-python]
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-coal-python-standalone-pixi-${{ matrix.os }}-${{ matrix.environment }}-${{ github.sha }}
restore-keys: ccache-coal-python-standalone-pixi-${{ matrix.os }}-${{ matrix.environment }}-
- uses: prefix-dev/setup-pixi@v0.9.3
with:
cache: true
environments: ${{ matrix.environment }}
- name: Clear ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -svz
- name: Build Coal cpp [MacOS/Linux/Windows]
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
run: |
pixi run -e ${{ matrix.environment }} configure -DBUILD_PYTHON_INTERFACE=OFF -B build_cpp
pixi run -e ${{ matrix.environment }} cmake --build build_cpp --target all
pixi run -e ${{ matrix.environment }} cmake --install build_cpp
- name: Build Coal standalone python [MacOS/Linux/Windows]
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
run: |
pixi run -e ${{ matrix.environment }} configure -DBUILD_PYTHON_INTERFACE=ON -DBUILD_STANDALONE_PYTHON_INTERFACE=ON -B build_python
pixi run -e ${{ matrix.environment }} cmake --build build_python --target all
pixi run -e ${{ matrix.environment }} cmake --install build_python
pixi run -e ${{ matrix.environment }} python -c "import coal"
- name: Show ccache statistics [MacOS/Linux/Windows]
run: |
pixi run -e ${{ matrix.environment }} ccache -sv
coal-pixi-build:
name: Pixi build - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: prefix-dev/setup-pixi@v0.9.3
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
with:
cache: true
environments: test-pixi-build
- name: Test package [MacOS/Linux/Windows]
run: |
pixi run -e test-pixi-build test
check:
if: always()
name: check-macos-linux-windows-pixi
needs:
- coal-pixi
- coal-python-standalone-pixi
- coal-pixi-build
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) }}