diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml new file mode 100644 index 0000000..9c5fe13 --- /dev/null +++ b/.github/workflows/ci-conda.yml @@ -0,0 +1,110 @@ +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 }}]" + 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"] + + 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: 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 \ + -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" \ + -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 }} diff --git a/SoftRobots.InverseConfig.cmake.in b/SoftRobots.InverseConfig.cmake.in index 54f7093..1c66f9f 100644 --- a/SoftRobots.InverseConfig.cmake.in +++ b/SoftRobots.InverseConfig.cmake.in @@ -10,7 +10,9 @@ find_package(Sofa.Component.SolidMechanics.FEM.Elastic QUIET REQUIRED) find_package(libqpOASES REQUIRED) include_directories(${OASES_INCLUDE_DIRS}) -find_package(proxsuite REQUIRED) +if(SOFTROBOTSINVERSE_ENABLE_PROXQP) + find_package(proxsuite QUIET REQUIRED) +endif() if(NOT TARGET @PROJECT_NAME@) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")