Skip to content

Commit

Permalink
Merge branch 'devel' into skleff/contact1d
Browse files Browse the repository at this point in the history
  • Loading branch information
skleff1994 authored Oct 20, 2023
2 parents 3dea282 + 499405e commit 1eef8b3
Show file tree
Hide file tree
Showing 88 changed files with 2,459 additions and 3,292 deletions.
112 changes: 112 additions & 0 deletions .github/workflows/conda-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CONDA

on: [push, pull_request]

jobs:
crocoddyl-conda:
name: (${{ matrix.os }}, clang, multi-threading, ipopt, ${{ matrix.build_type }})
runs-on: ${{ matrix.os }}
env:
CCACHE_DIR: ${{ matrix.CCACHE_DIR }}

strategy:
fail-fast: false
matrix:
# os: ["ubuntu-latest", "macos-latest"]
os: ["macos-latest"]
build_type: [Release, Debug]
compiler: [clang]

include:
# - os: ubuntu-latest
# CCACHE_DIR: /home/runner/.ccache
- os: macos-latest
CCACHE_DIR: /Users/runner/.ccache

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: crocoddyl
auto-update-conda: true
environment-file: .github/workflows/conda/conda-env.yml

- name: Install conda dependencies
shell: bash -l {0}
run: |
conda activate crocoddyl
conda install cmake ccache -c conda-forge
conda install llvm-openmp libcxx -c conda-forge
conda list
- name: Install example-robot-data
shell: bash -l {0}
run: |
conda activate crocoddyl
mkdir third-party && cd third-party
git clone --recursive https://github.com/Gepetto/example-robot-data.git
cd example-robot-data && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
make install
- name: Install compilers for macOS
shell: bash -l {0}
if: contains(matrix.os, 'macos-latest')
run: |
conda install compilers -c conda-forge
- name: Enable CppADCodeGen compilation
shell: bash -l {0}
if: contains(matrix.build_type, 'Release')
run: |
echo "codegen_support=ON" >> "$GITHUB_ENV"
- name: Disable CppADCodeGen compilation
shell: bash -l {0}
if: contains(matrix.build_type, 'Debug')
run: |
echo "codegen_support=OFF" >> "$GITHUB_ENV"
- name: Build Crocoddyl
shell: bash -l {0}
run: |
conda activate crocoddyl
echo $CONDA_PREFIX
mkdir build
cd build
cmake .. \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_WITH_CODEGEN_SUPPORT=${{ env.codegen_support }} -DPYTHON_EXECUTABLE=$(which python3) \
-DBUILD_WITH_MULTITHREADS=ON -DINSTALL_DOCUMENTATION=ON -DOpenMP_ROOT=$CONDA_PREFIX
make
- name: Run unit tests
shell: bash -l {0}
run: |
conda activate crocoddyl
cd build
export CTEST_OUTPUT_ON_FAILURE=1
make test
- name: Install Crocoddyl
shell: bash -l {0}
run: |
cd build
make install
- name: Uninstall Crocoddyl
shell: bash -l {0}
run: |
cd build
make uninstall
17 changes: 17 additions & 0 deletions .github/workflows/conda/conda-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: crocoddyl
channels:
- conda-forge
- nodefaults
dependencies:
- boost
- numpy
- scipy
- python
- eigen=3.4.0
- eigenpy
- hpp-fcl
- urdfdom
- cppad
- cppadcodegen
- pinocchio
- ipopt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: ROS-CI
name: ROS

# This determines when this workflow is run
on: [push, pull_request] # on all pushes and PRs
Expand All @@ -11,20 +8,12 @@ jobs:
strategy:
matrix:
env:
# Ubuntu 20.04, g++, Release
- {name: "Focal / g++ / Release", ROS_DISTRO: noetic}
# Ubuntu 20.04, clang, Release
- {name: "Focal / clang / Release", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++}
# Ubuntu 20.04, clang, Release, multi-threading
- {name: "Focal / clang / Release / Multi-threading", ROS_DISTRO: noetic, ADDITIONAL_DEBS: "clang libomp-dev", CC: clang, CXX: clang++, CMAKE_ARGS: "-DBUILD_WITH_MULTITHREADS=ON -DBUILD_WITH_NTHREADS=2"}
- {name: "(noetic)", ROS_DISTRO: noetic}
- {name: "(noetic, clang)", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++}
- {name: "(noetic, clang, multi-threading)", ROS_DISTRO: noetic, ADDITIONAL_DEBS: "clang libomp-dev", CC: clang, CXX: clang++, CMAKE_ARGS: "-DBUILD_WITH_MULTITHREADS=ON -DBUILD_WITH_NTHREADS=2"}
- {name: "(noetic, clang, Debug)", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++, CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug"}
# Format check
#- {name: "Format check", ROS_DISTRO: noetic, CLANG_FORMAT_CHECK: file, CLANG_FORMAT_VERSION: "6.0", BEFORE_RUN_CLANG_FORMAT_CHECK: "wget https://raw.githubusercontent.com/Gepetto/linters/master/.clang-format-6.0 -O /tmp/clang_format_check/crocoddyl/.clang-format", ADDITIONAL_DEBS: wget}
## Working configs for Debug mode. However, tests take too long in Debug mode (~1h on a laptop).
## Hence, not active on GitHub Actions
# # Ubuntu 20.04, g++, Debug
# - {name: "Focal / g++ / Debug", ROS_DISTRO: noetic, CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug'}
# Ubuntu 20.04, clang, Debug
- {name: "Focal / clang / Debug", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++, CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug"}
name: ${{ matrix.env.name }}
env:
CCACHE_DIR: /github/home/.ccache # Enable ccache
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ros2-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ROS

# This determines when this workflow is run
on: [push, pull_request]

jobs:
CI:
strategy:
matrix:
env:
- {name: "(humble, Release)", ROS_DISTRO: humble}
# - {name: "humble, multi-threading", ROS_DISTRO: humble, ADDITIONAL_DEBS: "libomp-dev", CMAKE_ARGS: "-DBUILD_WITH_MULTITHREADS=ON -DBUILD_WITH_NTHREADS=2"}
# - {name: "humble, Debug", ROS_DISTRO: noetic, CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug"}
- {name: "(rolling, Release)", ROS_DISTRO: rolling}
# - {name: "rolling, multi-threading", ROS_DISTRO: rolling, ADDITIONAL_DEBS: "libomp-dev", CMAKE_ARGS: "-DBUILD_WITH_MULTITHREADS=ON -DBUILD_WITH_NTHREADS=2"}
# - {name: "rolling, Debug", ROS_DISTRO: rolling, CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug"}
name: ${{ matrix.env.name }}
env:
CCACHE_DIR: /github/home/.ccache # Enable ccache
UPSTREAM_WORKSPACE: dependencies.rosinstall # to build example-robot-data from source as it's not released via the ROS buildfarm
CTEST_OUTPUT_ON_FAILURE: 1
BUILDER: colcon
# This by-passes issues on importing example_robot_data module when running examples and unit tests.
# It seems target_ws is unable to properly overlay upstream_ws.
AFTER_SETUP_UPSTREAM_WORKSPACE: 'pip install example-robot-data'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# This step will fetch/store the directory used by ccache before/after the ci run
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
- uses: 'ros-industrial/industrial_ci@master'
env: ${{ matrix.env }}
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ repos:
hooks:
- id: toml-sort-fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.4
rev: v17.0.2
hooks:
- id: clang-format
args:
- --style=Google
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -44,11 +44,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args:
Expand Down
Loading

0 comments on commit 1eef8b3

Please sign in to comment.