Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel' into pybind11/type_caster
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Nov 26, 2021
2 parents 25d5728 + 624237c commit ec7c8f6
Show file tree
Hide file tree
Showing 60 changed files with 3,429 additions and 3,181 deletions.
108 changes: 59 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'

env:
YCM_TAG: v0.12.0
YARP_TAG: v3.4.1
ICUB_TAG: v1.17.0

jobs:
build-with-conda-dependencies:
build-with-conda-dependencies:
name: '[conda:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,25 +33,25 @@ jobs:
channels: conda-forge,robotology

- name: Install files to enable compilation of mex files [Conda/Linux]
if: contains(matrix.os, 'ubuntu')
if: contains(matrix.os, 'ubuntu')
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020b_mexa64.zip
unzip msdk_R2020b_mexa64.zip
rm msdk_R2020b_mexa64.zip
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020b_mexa64" >> $GITHUB_ENV
echo "GHA_Matlab_MEX_EXTENSION=mexa64" >> $GITHUB_ENV
- name: Install files to enable compilation of mex files [Conda/macOS]
if: contains(matrix.os, 'macos')
if: contains(matrix.os, 'macos')
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexmaci64.zip
unzip msdk_R2020a_mexmaci64.zip
rm msdk_R2020a_mexmaci64.zip
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexmaci64" >> $GITHUB_ENV
echo "GHA_Matlab_MEX_EXTENSION=mexmaci64" >> $GITHUB_ENV
- name: Install files to enable compilation of mex files [Conda/Windows]
if: contains(matrix.os, 'windows')
if: contains(matrix.os, 'windows')
shell: bash
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexw64.zip
Expand All @@ -65,37 +65,37 @@ jobs:
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
# Compilation related dependencies
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install eigen libxml2 assimp ipopt qt irrlicht
mamba install eigen libxml2 assimp ipopt qt irrlicht swig pybind11 python numpy
# robotology dependencies
mamba install yarp icub-main osqp-eigen
# Additional dependencies useful only on Linux
- name: Dependencies [Conda/Linux]
if: contains(matrix.os, 'ubuntu')
if: contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
# Additional dependencies only useful on Linux
# See https://github.com/robotology/robotology-superbuild/issues/477
mamba install expat-cos6-x86_64 freeglut libselinux-cos6-x86_64 libxau-cos6-x86_64 libxcb-cos6-x86_64 libxdamage-cos6-x86_64 libxext-cos6-x86_64 libxfixes-cos6-x86_64 libxxf86vm-cos6-x86_64 mesalib mesa-libgl-cos6-x86_64
mamba install expat-cos6-x86_64 freeglut libselinux-cos6-x86_64 libxau-cos6-x86_64 libxcb-cos6-x86_64 libxdamage-cos6-x86_64 libxext-cos6-x86_64 libxfixes-cos6-x86_64 libxxf86vm-cos6-x86_64 mesa-libgl-cos6-x86_64 mesa-libgl-devel-cos6-x86_64
- 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 }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} -DIDYNTREE_DISABLE_MATLAB_TESTS:BOOL=ON -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_QT5:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON -DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON ..
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} -DIDYNTREE_DISABLE_MATLAB_TESTS:BOOL=ON -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_QT5:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON -DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON -DIDYNTREE_USES_PYTHON:BOOL=ON -DIDYNTREE_USES_PYTHON_PYBIND11:BOOL=ON ..
- name: Configure [Conda/Windows]
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} -DIDYNTREE_DISABLE_MATLAB_TESTS:BOOL=ON -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_QT5:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON -DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON ..
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMATLAB_FIND_DEBUG:BOOL=ON -DIDYNTREE_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} -DIDYNTREE_DISABLE_MATLAB_TESTS:BOOL=ON -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_QT5:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON -DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_OSQPEIGEN:BOOL=ON -DIDYNTREE_USES_PYTHON:BOOL=ON -DIDYNTREE_USES_PYTHON_PYBIND11:BOOL=ON ..
- name: Build [Conda]
shell: bash -l {0}
Expand All @@ -110,19 +110,29 @@ jobs:
cd build
ldd ./lib/iDynTreeMEX.mexa64
- name: Test [Conda]
- name: Test [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
cd build
# Visualizer tests excluded as a workaround for https://github.com/robotology/idyntree/issues/808
ctest --output-on-failure -C ${{ matrix.build_type }} -E "Visualizer|matlab" .
ctest --output-on-failure -C ${{ matrix.build_type }} -E "Visualizer|matlab" .
- name: Test [Conda/Windows]
if: contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
cd build
# Visualizer tests excluded as a workaround for https://github.com/robotology/idyntree/issues/808
# Python tests excluded as a workaround for https://github.com/robotology/idyntree/issues/939
ctest --output-on-failure -C ${{ matrix.build_type }} -E "Visualizer|matlab|Python|pybind" .
- name: Install [Conda]
shell: bash -l {0}
run: |
cd build
cmake --install . --config ${{ matrix.build_type }}
- name: Test standalone installation of MATLAB bindings [Conda/Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
Expand Down Expand Up @@ -159,25 +169,25 @@ jobs:


- name: Install files to enable compilation of mex files [Linux]
if: contains(matrix.os, 'ubuntu')
if: contains(matrix.os, 'ubuntu')
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020b_mexa64.zip
unzip msdk_R2020b_mexa64.zip
rm msdk_R2020b_mexa64.zip
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020b_mexa64" >> $GITHUB_ENV
echo "GHA_Matlab_MEX_EXTENSION=mexa64" >> $GITHUB_ENV
- name: Install files to enable compilation of mex files [macOS]
if: contains(matrix.os, 'macos')
if: contains(matrix.os, 'macos')
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexmaci64.zip
unzip msdk_R2020a_mexmaci64.zip
rm msdk_R2020a_mexmaci64.zip
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexmaci64" >> $GITHUB_ENV
echo "GHA_Matlab_MEX_EXTENSION=mexmaci64" >> $GITHUB_ENV
- name: Install files to enable compilation of mex files [Windows]
if: contains(matrix.os, 'windows')
if: contains(matrix.os, 'windows')
shell: bash
run: |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexw64.zip
Expand All @@ -190,23 +200,23 @@ jobs:
- name: Environment Variables
shell: bash
run: env
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323

# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
if: contains(matrix.os, 'ubuntu')
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# ============
# DEPENDENCIES
# ============

- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ace assimp boost eigen ipopt irrlicht swig qt5
- name: Dependencies [Ubuntu]
if: contains(matrix.os, 'ubuntu')
run: |
Expand All @@ -215,9 +225,9 @@ jobs:
git build-essential cmake libace-dev coinor-libipopt-dev libeigen3-dev swig \
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5charts5-dev \
libxml2-dev liboctave-dev python-dev python3-numpy valgrind libassimp-dev libirrlicht-dev
- name: Source-based Dependencies [Ubuntu/macOS]
- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-latest')
shell: bash
run: |
Expand All @@ -227,28 +237,28 @@ jobs:
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install
cmake --build . --config ${{ matrix.build_type }} --target install
# YARP
git clone -b ${YARP_TAG} https://github.com/robotology/yarp
cd yarp
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install
cmake --build . --config ${{ matrix.build_type }} --target install
# ICUB
git clone -b ${ICUB_TAG} https://github.com/robotology/icub-main
cd icub-main
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install
cmake --build . --config ${{ matrix.build_type }} --target install
- name: Dependencies (workaround for portaudio YCM problem) [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install octave
# ===================
# CMAKE-BASED PROJECT
# ===================
Expand All @@ -264,7 +274,7 @@ jobs:
-DIDYNTREE_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} -DIDYNTREE_DISABLE_MATLAB_TESTS:BOOL=ON \
-DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_OCTAVE:BOOL=ON -DIDYNTREE_USES_IRRLICHT:BOOL=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Enable additional Ubuntu options (Valgrind, Python) [Ubuntu]
- name: Enable additional Ubuntu options (Valgrind, Python) [Ubuntu]
if: contains(matrix.os, 'ubuntu')
run: |
cd build
Expand All @@ -274,43 +284,43 @@ jobs:
# As a workaround, we test against the regular blas instead of openblas
sudo apt-get install libblas-dev libatlas-base-dev
sudo apt-get remove libopenblas-base
- name: Build
shell: bash
run: |
cd build
# Attempt of fix for using YARP idl generators (that link ACE) in Windows
# Attempt of fix for using YARP idl generators (that link ACE) in Windows
# See https://github.com/robotology/idyntree/issues/569
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/debug/bin
cmake --build . --config ${{ matrix.build_type }}
- name: Test
shell: bash
run: |
cd build
# Visualizer tests excluded as a workaround for https://github.com/robotology/idyntree/issues/808
ctest --output-on-failure -C ${{ matrix.build_type }} -E "Visualizer|matlab" .
ctest --output-on-failure -C ${{ matrix.build_type }} -E "Visualizer|matlab" .
- name: Install [Ubuntu/macOS]
if: contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-latest'
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install
- name: Compile Examples [Ubuntu/macOS]
if: contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-latest'
shell: bash
run: |
cd examples
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/install/deps;${GITHUB_WORKSPACE}/install" ..
cmake -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/install/deps;${GITHUB_WORKSPACE}/install" ..
cmake --build . --config ${{ matrix.build_type }}
- name: Check build if some dependencies are not enabled [Ubuntu]
if: contains(matrix.os, 'ubuntu')
shell: bash
Expand All @@ -321,6 +331,6 @@ jobs:
# Deselect missing dependency and build
cmake -DIDYNTREE_USES_${missing_dep}:BOOL=OFF .
cmake --build . --config ${{ matrix.build_type }}
# Enable again dependency
# Enable again dependency
cmake -DIDYNTREE_USES_${missing_dep}:BOOL=ON .
done
74 changes: 74 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: gh-pages
on:
push:
branches:
- '*'
- '!gh-pages'

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master

- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge
channel-priority: true

- name: Dependencies [apt]
shell: bash -l {0}
run: |
# The following dependencies are not available in conda
# See: https://github.com/conda-forge/texlive-core-feedstock/issues/19
sudo apt update
sudo apt install -y xsltproc texlive ghostscript graphviz texlive-base texlive-latex-extra texlive-fonts-extra texlive-fonts-recommended flex bison
- name: Dependencies
shell: bash -l {0}
run: |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
conda config --remove channels defaults
# Dependencies
mamba install doxygen toml pygments docutils jinja2
- name: Fetch m.css
shell: bash -l {0}
run: |
# Use an unofficial version of m.css because of https://github.com/mosra/m.css/pull/189
cd ${GITHUB_WORKSPACE}
git clone https://github.com/crisluengo/m.css.git
cd m.css
git checkout fix-class-parsed-as-function
- name: Build docs
shell: bash -l {0}
run: |
cd docs
git clone https://github.com/robotology/idyntree.git
python3 ./generate_website.py --mcss_path ${GITHUB_WORKSPACE}/m.css/documentation/doxygen.py
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: site
path: docs/site

deploy:
runs-on: ubuntu-20.04
needs: [build]
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: site
path: site
- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: site
Loading

0 comments on commit ec7c8f6

Please sign in to comment.