C++ CI Workflow #6728
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: C++ CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# Execute a "nightly" build at 2 AM UTC | |
- cron: '0 2 * * *' | |
env: | |
vcpkg_robotology_TAG: v0.11.0 | |
YCM_TAG: v0.15.3 | |
YARP_TAG: v3.8.0 | |
iDynTree_TAG: v12.3.3 | |
CasADi_TAG: 3.5.5.2 | |
manif_TAG: 0.0.5 | |
matioCpp_TAG: v0.2.5 | |
LieGroupControllers_TAG: v0.2.0 | |
osqp_TAG: v0.6.3 | |
OsqpEigen_TAG: v0.7.0 | |
tomlplusplus_TAG: v3.0.1 | |
icub_models_TAG: v2.4.0 | |
UnicyclePlanner_TAG: v0.7.0 | |
telemetry_TAG: v1.2.0 | |
bayes_filters_TAG: 53124b1d85fc00c8cd44d572a1e482d7e58c0f50 | |
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg | |
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg | |
# Default number of cores set to one | |
NUM_CORES_FOR_CMAKE_BUILD: 1 | |
jobs: | |
check-style: | |
name: Find Trailing Whitespace | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Find Trailing Whitespace | |
run: | | |
set +e | |
lines=$(git grep --cached -In '[[:blank:]]$') | |
if [ ! -z "$lines" ]; then | |
echo -e "\n The following lines contain trailing whitespace: \n" | |
echo -e "${lines}" | |
echo -e "\nFailed.\n" | |
exit 1 | |
fi | |
exit 0 | |
build: | |
needs: check-style | |
name: '[${{ matrix.os }}@${{ matrix.build_type }}]' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build_type: [Release, Debug] | |
os: [ubuntu-20.04, windows-2019] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
# Print environment variables to simplify development and debugging | |
- name: Environment Variables | |
shell: bash | |
run: env | |
# ============ | |
# DEPENDENCIES | |
# ============ | |
# 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: startsWith(matrix.os, 'ubuntu') | |
run: | | |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | |
- name: Dependencies [Windows] | |
if: matrix.os == 'windows-2019' | |
run: | | |
# To avoid spending a huge time compiling vcpkg dependencies, we download a root that comes precompiled with all the ports that we need | |
choco install -y wget unzip | |
# To avoid problems with non-relocatable packages, we unzip the archive exactly in the same C:/robotology/vcpkg | |
# that has been used to create the pre-compiled archive | |
cd C:/ | |
wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/${env:vcpkg_robotology_TAG}/vcpkg-robotology.zip | |
unzip vcpkg-robotology.zip -d C:/ | |
rm vcpkg-robotology.zip | |
- name: Dependencies [Ubuntu] | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install git build-essential cmake libace-dev coinor-libipopt-dev \ | |
libboost-system-dev libboost-filesystem-dev libboost-thread-dev \ | |
liborocos-kdl-dev libeigen3-dev swig qtbase5-dev qtdeclarative5-dev \ | |
qtmultimedia5-dev libxml2-dev liburdfdom-dev libtinyxml-dev \ | |
liburdfdom-dev liboctave-dev python3-dev valgrind coinor-libipopt-dev \ | |
libmatio-dev python3-pytest python3-numpy python3-scipy \ | |
python3-setuptools libspdlog-dev libopencv-dev libpcl-dev \ | |
python3-pybind11 nlohmann-json3-dev libassimp-dev libqhull-dev | |
# install realsense from apt (see https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages) | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCD | |
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u | |
# please see https://github.com/IntelRealSense/realsense-ros/blob/a161efb84c9cf8077fbd37d6a78ef1fad0b677d0/.travis.yml#L17-L19 | |
sudo apt-get update -qq | |
# please see https://github.com/IntelRealSense/librealsense/issues/9607#issuecomment-896789179 | |
mkdir -p /usr/share/librealsense2/presets | |
sudo apt-get install librealsense2-dev | |
# Get the number of cores | |
- name: Get number of cores to speed up cmake build and test to skip [Windows] | |
if: matrix.os == 'windows-2019' | |
run: | | |
echo "NUM_CORES_FOR_CMAKE_BUILD=$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" >> $env:GITHUB_ENV | |
echo "BLF_TEST_TO_SKIP=YarpRobotLoggerDeviceUnitTests" >> $env:GITHUB_ENV | |
- name: Get number of cores to speed up cmake build and test to suppress [Ubuntu] | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
echo "NUM_CORES_FOR_CMAKE_BUILD=`nproc --all`" >> $GITHUB_ENV | |
echo "BLF_TEST_TO_SKIP=" >> $env:GITHUB_ENV | |
- name: Cache Source-based Dependencies | |
id: cache-source-deps | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/install/deps | |
key: source-deps-${{ runner.os }}-os-${{ matrix.os }}-build-type-${{ matrix.build_type }}-vcpkg-robotology-${{ env.vcpkg_robotology_TAG }}-ycm-${{ env.YCM_TAG }}-yarp-${{ env.YARP_TAG }}-iDynTree-${{ env.iDynTree_TAG }}-casADi-${{ env.CasADi_TAG }}-manif-${{ env.manif_TAG }}-matioCpp-${{ env.matioCpp_TAG }}-LieGroupControllers-${{ env.LieGroupControllers_TAG }}-osqp-${{ env.osqp_TAG }}-osqp-eigen-${{ env.OsqpEigen_TAG }}-tomlplusplus-${{ env.tomlplusplus_TAG }}-unicycle-${{ env.UnicyclePlanner_TAG }}-icub-models-${{ env.icub_models_TAG }}-robometry-${{ env.telemetry_TAG }}-bayes-filters-${{ env.bayes_filters_TAG }} | |
- name: Source-based Dependencies [Windows] | |
if: steps.cache-source-deps.outputs.cache-hit != 'true' && matrix.os == 'windows-2019' | |
shell: bash | |
run: | | |
# YCM | |
cd ${GITHUB_WORKSPACE} | |
git clone -b ${YCM_TAG} https://github.com/robotology/ycm | |
cd ycm | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target INSTALL -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# YARP | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/yarp | |
cd yarp | |
git checkout ${YARP_TAG} | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DYARP_COMPILE_GUIS:BOOL=OFF -DYARP_COMPILE_ALL_FAKE_DEVICES:BOOL=ON \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target INSTALL -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# Workaround for https://github.com/robotology-dependencies/robotology-vcpkg-binary-ports/issues/3 | |
export IPOPT_DIR=${VCPKG_INSTALLATION_ROOT}/installed/x64-windows | |
# iDynTree | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/iDynTree | |
cd iDynTree | |
git checkout ${iDynTree_TAG} | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# osqp | |
cd ${GITHUB_WORKSPACE} | |
git clone --recursive -b ${osqp_TAG} https://github.com/oxfordcontrol/osqp | |
cd osqp | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# osqp-eigen | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/osqp-eigen | |
cd osqp-eigen | |
git checkout ${OsqpEigen_TAG} | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# CasADi | |
# We override the casadi installation structure to be compliant with the folder structure used for | |
# the other dependencies. Please check: | |
# https://github.com/casadi/casadi/blob/6f122ca22e2a869903628c5738f154c8ac0f7455/CMakeLists.txt#L317 | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/casadi.git -b ${CasADi_TAG} casadi | |
cd casadi | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps \ | |
-DINCLUDE_PREFIX:PATH="include" \ | |
-DCMAKE_PREFIX:PATH="lib/cmake/casadi" \ | |
-DLIB_PREFIX:PATH="lib" \ | |
-DBIN_PREFIX:PATH="bin" \ | |
-DWITH_IPOPT=BOOL:ON \ | |
-DWITH_OSQP:BOOL=ON -DUSE_SYSTEM_WISE_OSQP=BOOL:ON .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# manif | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/artivis/manif.git | |
cd manif | |
git checkout ${manif_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# matioCpp | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/matio-cpp | |
cd matio-cpp | |
git checkout ${matioCpp_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# LieGroupControllers | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/lie-group-controllers | |
cd lie-group-controllers | |
git checkout ${LieGroupControllers_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# UnicycleFootstepPlanner | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/unicycle-footstep-planner | |
cd unicycle-footstep-planner | |
git checkout ${UnicyclePlanner_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# icub-models | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/icub-models | |
cd icub-models | |
git checkout ${icub_models_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps \ | |
-DICUB_MODELS_USES_PYTHON:BOOL=ON .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# robometry | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/robometry | |
cd robometry | |
git checkout ${telemetry_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# bayes-filters | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/bayes-filters-lib | |
cd bayes-filters-lib | |
git checkout ${bayes_filters_TAG} | |
mkdir build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
- name: Source-based Dependencies [Ubuntu] | |
if: steps.cache-source-deps.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') | |
shell: bash | |
run: | | |
# Tomlplusplus | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/marzer/tomlplusplus | |
cd tomlplusplus | |
git checkout ${tomlplusplus_TAG} | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# YCM | |
cd ${GITHUB_WORKSPACE} | |
git clone -b ${YCM_TAG} https://github.com/robotology/ycm | |
cd ycm | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# YARP | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/yarp | |
cd yarp | |
git checkout ${YARP_TAG} | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps -DYARP_COMPILE_ALL_FAKE_DEVICES:BOOL=ON .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# iDynTree | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/iDynTree | |
cd iDynTree | |
git checkout ${iDynTree_TAG} | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DIDYNTREE_USES_PYTHON:BOOL=ON \ | |
-DIDYNTREE_USES_ASSIMP:BOOL=ON \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# osqp | |
cd ${GITHUB_WORKSPACE} | |
git clone --recursive -b ${osqp_TAG} https://github.com/oxfordcontrol/osqp | |
cd osqp | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# osqp-eigen | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/osqp-eigen | |
cd osqp-eigen | |
git checkout ${OsqpEigen_TAG} | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# CasADi | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/casadi.git -b ${CasADi_TAG} casadi | |
cd casadi | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps -DWITH_IPOPT=BOOL:ON \ | |
-DWITH_OSQP:BOOL=ON -DUSE_SYSTEM_WISE_OSQP=BOOL:ON .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# manif | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/artivis/manif.git | |
cd manif | |
git checkout ${manif_TAG} | |
mkdir build | |
cd build | |
cmake -DBUILD_PYTHON_BINDINGS:BOOL=ON -DMANIFPY_PKGDIR:PATH=${GITHUB_WORKSPACE}/install/deps/lib/python3/dist-packages -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# matioCpp | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/matio-cpp | |
cd matio-cpp | |
git checkout ${matioCpp_TAG} | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# LieGroupControllers | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/ami-iit/lie-group-controllers | |
cd lie-group-controllers | |
git checkout ${LieGroupControllers_TAG} | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# UnicycleFootstepPlanner | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/unicycle-footstep-planner | |
cd unicycle-footstep-planner | |
git checkout ${UnicyclePlanner_TAG} | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# icub-models | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/icub-models | |
cd icub-models | |
git checkout ${icub_models_TAG} | |
mkdir build | |
cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps -DICUB_MODELS_USES_PYTHON:BOOL=ON .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# robometry | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/robometry | |
cd robometry | |
git checkout ${telemetry_TAG} | |
mkdir build && cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# bayes-filters | |
cd ${GITHUB_WORKSPACE} | |
git clone https://github.com/robotology/bayes-filters-lib | |
cd bayes-filters-lib | |
git checkout ${bayes_filters_TAG} | |
mkdir build && cd build | |
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
- name: Source-based Dependencies [Ubuntu] | |
if: steps.cache-source-deps.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') | |
shell: bash | |
run: | | |
# CppAD | |
git clone https://github.com/coin-or/CppAD.git | |
cd CppAD | |
mkdir -p build | |
cd build | |
cmake -Dcppad_prefix=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps \ | |
-DBUILD_TESTING=OFF .. | |
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
- name: Check Python setup | |
shell: bash | |
run: | | |
echo "Default interpreter: $(which python)" | |
python3 -c 'import sys; print(sys.prefix)' | |
- name: Extend the pythonpath and LD_LIBRARY_PATH [Ubuntu] | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
echo "PYTHONPATH=${GITHUB_WORKSPACE}/install/deps/lib/python3/dist-packages" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${GITHUB_WORKSPACE}/install/deps/lib" >> $GITHUB_ENV | |
# =================== | |
# CMAKE-BASED PROJECT | |
# =================== | |
- name: Configure [Windows] | |
# Use bash also on Windows (otherwise cd, mkdir, ... do not work) | |
if: matrix.os == 'windows-2019' | |
shell: bash | |
run: | | |
mkdir -p build | |
cd build | |
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ | |
-DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=OFF \ | |
-DBUILD_TESTING:BOOL=ON .. | |
- name: Configure [Ubuntu] | |
if: startsWith(matrix.os, 'ubuntu') | |
shell: bash | |
run: | | |
mkdir -p build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \ | |
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ | |
-DBUILD_TESTING:BOOL=ON \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON \ | |
-DPython3_ROOT_DIR=$(python -c "import sys; print(sys.prefix)") -DFRAMEWORK_USE_Python3:BOOL=ON -DFRAMEWORK_USE_pybind11:BOOL=ON \ | |
-DENABLE_YarpRobotLoggerDevice:BOOL=ON \ | |
-DFRAMEWORK_RUN_Valgrind_tests:BOOL=ON .. | |
- name: Check build if some dependencies are not enabled [Ubuntu] | |
if: github.event_name != 'push' && github.event_name != 'release' && matrix.os == 'ubuntu-20.04' | |
shell: bash | |
run: | | |
cd build | |
for missing_dep in YARP Qhull casadi cppad manif Python3 pybind11 pytest matioCpp LieGroupControllers nlohmann_json UnicyclePlanner icub-models BayesFilters; do | |
echo "Testing ${missing_dep} as missing dependency." | |
# Deselect missing dependencies and build | |
cmake -DFRAMEWORK_USE_${missing_dep}:BOOL=OFF . | |
cmake --build . --config ${{ matrix.build_type }} -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
# Enable again dependency | |
cmake -DFRAMEWORK_USE_${missing_dep}:BOOL=ON . | |
done | |
- name: Build | |
shell: bash | |
run: | | |
cd build | |
# Attempt of fix for using YARP idl generators (that link ACE) in Windows | |
# See https://github.com/robotology/idyntree/issues/569 | |
export PATH=$PATH:/d/a/bipedal-locomotion-framework/bipedal-locomotion-framework/install/bin:/d/a/bipedal-locomotion-framework/bipedal-locomotion-framework/install/deps/bin:/c/robotology/vcpkg/installed/x64-windows/bin:/c/robotology/vcpkg/installed/x64-windows/debug/bin | |
cmake --build . --config ${{ matrix.build_type }} -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} | |
- name: Test | |
shell: bash | |
run: | | |
cd build | |
export PATH=$PATH:/d/a/bipedal-locomotion-framework/bipedal-locomotion-framework/install/bin:/d/a/bipedal-locomotion-framework/bipedal-locomotion-framework/install/deps/bin:/c/robotology/vcpkg/installed/x64-windows/bin:/c/robotology/vcpkg/installed/x64-windows/debug/bin | |
ctest -E "${BLF_TEST_TO_SKIP}" --output-on-failure -C ${{ matrix.build_type }} -j${{env.NUM_CORES_FOR_CMAKE_BUILD}} . |