Skip to content

Refactor CMake with JRL CMake Modules v2 #1590

Refactor CMake with JRL CMake Modules v2

Refactor CMake with JRL CMake Modules v2 #1590

name: CI - Linux/OSX/Windows - Conda
on:
push:
branches:
- devel
pull_request:
paths-ignore:
- CHANGELOG.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-with-conda:
name: '[conda:${{ matrix.name }}:${{ matrix.build_type }}:c++${{ matrix.cxx_std }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
name: [ubuntu-latest, macos-latest, windows-latest-clang-cl, windows-latest, macos-15-intel]
cxx_std: [17, 20]
continue_on_error: [false]
include:
- name: ubuntu-latest
os: ubuntu-latest
- name: macos-latest
os: macos-latest
- name: macos-15-intel
os: macos-15-intel
- name: windows-latest-clang-cl
os: windows-latest
compiler: clang-cl
- name: windows-latest
os: windows-latest
compiler: cl
- name: macos-latest
os: macos-latest
build_type: Debug
cxx_std: 17
continue_on_error: true
- name: macos-latest
os: macos-latest
build_type: Debug
cxx_std: 20
continue_on_error: true
exclude:
- name: macos-latest
build_type: Debug
cxx_std: 17
continue_on_error: false
- name: macos-latest
build_type: Debug
cxx_std: 20
continue_on_error: false
steps:
- uses: actions/checkout@v6
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: proxsuite
environment-file: .github/workflows/conda/environment.yml
auto-activate-base: false
auto-update-conda: true
- name: Activate ccache [Conda]
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_std }}
max-size: 1G
- name: Print environment [Conda]
run: |
conda info
conda list
env
- name: Configure [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
shell: bash -el {0}
env:
CMAKE_CXX_COMPILER_LAUNCHER: ccache
run: |
cmake -B build -S . -G Ninja -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DCMAKE_INSTALL_PREFIX="${CONDA_PREFIX}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE=ON -DBUILD_DOCUMENTATION=ON -DINSTALL_DOCUMENTATION=ON -DBUILD_WITH_VECTORIZATION_SUPPORT=ON
- name: Configure [Conda/Windows]
if: contains(matrix.os, 'windows-')
shell: cmd /C CALL {0}
env:
CMAKE_CXX_COMPILER_LAUNCHER: ccache
run: |
set CC=${{ matrix.compiler }}
set CXX=${{ matrix.compiler }}
cmake -B build -S . -G Ninja -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%/Library" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }} -DBUILD_PYTHON_INTERFACE=ON -DBUILD_WITH_OPENMP_SUPPORT=ON -DLINK_PYTHON_INTERFACE_TO_OPENMP=ON -DBUILD_DOCUMENTATION=ON -DINSTALL_DOCUMENTATION=ON -DBUILD_WITH_VECTORIZATION_SUPPORT=ON
- name: Build [Conda/Linux&macOS]
if: contains(matrix.os, 'macos-') || contains(matrix.os, 'ubuntu')
shell: bash -el {0}
run: |
cmake --build build --config ${{ matrix.build_type }} -v -j 1
- name: Build [Conda/Windows]
if: contains(matrix.os, 'windows-')
shell: cmd /C CALL {0}
run: |
cmake --build build --config ${{ matrix.build_type }} -v -j 1
- name: Build documentation [Conda]
run: |
cmake --build build --config ${{ matrix.build_type }} --target doc
- name: Install [Conda]
run: |
cmake --install build --config ${{ matrix.build_type }}
- name: Test [Conda]
continue-on-error: ${{ matrix.continue_on_error }}
run: |
ctest --test-dir build --output-on-failure -C ${{ matrix.build_type }}
- name: Test FetchContent packaging [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -el {0}
run: |
export PROXSUITE_GIT_REPOSITORY="file://"$GITHUB_WORKSPACE
export PROXSUITE_GIT_TAG="test-external-"$(git rev-parse --short HEAD)
git tag $PROXSUITE_GIT_TAG
cmake -B build/test-packaging-external -S test/packaging/external -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build/test-packaging-external --config ${{ matrix.build_type }}
- name: Test CMake packaging [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -el {0}
run: |
cmake -B build/test-packaging-cmake -S test/packaging/cmake -DCMAKE_INSTALL_PREFIX="${CONDA_PREFIX}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build/test-packaging-cmake --config ${{ matrix.build_type }}
- name: Test CMake packaging with components [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -el {0}
run: |
cmake -B build/test-packaging-cmake-components -S test/packaging/cmake-components -DCMAKE_INSTALL_PREFIX="${CONDA_PREFIX}" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_WITH_VECTORIZATION_SUPPORT=ON
cmake --build build/test-packaging-cmake-components --config ${{ matrix.build_type }}
- name: Uninstall [Conda]
run: |
cmake --build build --config ${{ matrix.build_type }} --target uninstall
- name: Display ccache statistics [Conda]
run: |
echo $(ccache -s)
check:
if: always()
name: check-ci-linux-osx-win-conda
needs:
- build-with-conda
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) }}