[config] Allow external qpOASES dependency #38
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - Linux/OSX/Windows - Conda | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
jobs: | |
build-with-conda-and-test: | |
name: "[conda:${{ matrix.os }}:py${{ matrix.python_version }}:${{ matrix.qp_solver }}]" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-13, macos-14, windows-2022] | |
python_version: ["3.13"] | |
build_type: ["Release"] | |
qp_solver: ["qpOases", "proxQP"] | |
steps: | |
- name: Install miniconda [Linux & macOS & Windows] | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: sofa | |
auto-update-conda: true | |
miniforge-version: latest | |
python-version: ${{ matrix.python_version }} | |
channels: conda-forge | |
conda-remove-defaults: "true" | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install SOFA from nightly packages [Conda] | |
shell: bash -l {0} | |
run: | | |
conda install sofa-devel sofa-python3 sofa-stlib sofa-softrobots -c sofa-framework-nightly | |
- name: Install compilation environment [Conda / Linux] | |
if: contains(matrix.os, 'ubuntu') | |
shell: bash -l {0} | |
run: | | |
conda install cmake compilers make ninja | |
conda install mesa-libgl-devel-cos7-x86_64 | |
- name: Install compilation environment [Conda / macOS] | |
if: contains(matrix.os, 'macos') | |
shell: bash -l {0} | |
run: | | |
conda install cmake compilers make ninja | |
- name: Install compilation environment [Conda / Windows] | |
if: contains(matrix.os, 'windows') | |
shell: bash -l {0} | |
run: | | |
conda install cmake vs2022_win-64 | |
- name: Install dependencies [Conda] | |
shell: bash -l {0} | |
run: | | |
conda install eigen libboost-headers pybind11 cxxopts | |
- name: Install QP solver dependencies [Conda / proxQP] | |
if: contains(matrix.qp_solver, 'proxQP') | |
shell: bash -l {0} | |
run: | | |
conda install proxsuite | |
echo "CMAKE_OPTS_QPSOLVER=-DSOFTROBOTSINVERSE_ENABLE_PROXQP=ON -DSOFTROBOTSINVERSE_ENABLE_QPOASES=OFF" >> "$GITHUB_ENV" | |
- name: Install QP solver dependencies [Conda / qpOases & not osx-arm64] | |
if: contains(matrix.qp_solver, 'qpOases') && !contains(matrix.os, 'macos-14') | |
shell: bash -l {0} | |
run: | | |
conda install qpoases | |
echo "CMAKE_OPTS_QPSOLVER=-DSOFTROBOTSINVERSE_ENABLE_PROXQP=OFF -DSOFTROBOTSINVERSE_ENABLE_QPOASES=ON" >> "$GITHUB_ENV" | |
# Use embedded qpOases version as its conda package for python>3.10 under osx-arm64 platform is not supported anymore | |
- name: Install QP solver dependencies [Conda / qpOases & osx-arm64] | |
if: contains(matrix.qp_solver, 'qpOases') && contains(matrix.os, 'macos-14') | |
shell: bash -l {0} | |
run: | | |
echo "CMAKE_OPTS_QPSOLVER=-DSOFTROBOTSINVERSE_ENABLE_PROXQP=OFF -DSOFTROBOTSINVERSE_ENABLE_QPOASES=ON" >> "$GITHUB_ENV" | |
- name: Print environment [Conda] | |
shell: bash -l {0} | |
run: | | |
conda info | |
conda list | |
env | |
- name: Configure [Conda / Linux & macOS] | |
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') | |
shell: bash -l {0} | |
run: | | |
mkdir build | |
cd build | |
cmake .. -GNinja $CMAKE_OPTS_QPSOLVER \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/bin/python \ | |
-DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=ON | |
- name: Configure [Conda / Windows] | |
if: contains(matrix.os, 'windows') | |
shell: bash -l {0} | |
run: | | |
mkdir build | |
cd build | |
cmake .. -G"Visual Studio 17 2022" -T "v143" $CMAKE_OPTS_QPSOLVER \ | |
-DCMAKE_GENERATOR_PLATFORM=x64 \ | |
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/python.exe \ | |
-DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=ON | |
- name: Build [Conda] | |
shell: bash -l {0} | |
run: | | |
cd build | |
cmake --build . --config ${{ matrix.build_type }} -v -j 2 | |
- name: Install [Conda] | |
shell: bash -l {0} | |
run: | | |
cd build | |
cmake --install . --config ${{ matrix.build_type }} | |
- name: Test [Conda] | |
shell: bash -l {0} | |
run: | | |
cd build | |
ctest --output-on-failure -C ${{ matrix.build_type }} |