Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a conda based CI workflow #53

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 3 additions & 1 deletion SoftRobots.InverseConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}/@[email protected]")
Expand Down
Loading