[master] update matlab bindings 2025/11/15 #579
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: | |
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 * * *' | |
jobs: | |
build-with-conda-dependencies: | |
name: '[conda:${{ matrix.os }}]' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [Release] | |
os: [ubuntu-20.04, macos-latest, windows-2019] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
channels: conda-forge | |
- name: Install files to enable compilation of mex files [Conda/Linux] | |
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') | |
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') | |
shell: bash | |
run: | | |
curl -L -O https://github.com/robotology/robotology-vcpkg-ports/releases/download/storage/msdk_R2020a_mexw64.zip | |
unzip msdk_R2020a_mexw64.zip | |
rm msdk_R2020a_mexw64.zip | |
echo "GHA_Matlab_ROOT_DIR=${GITHUB_WORKSPACE}/msdk_R2020a_mexw64" >> $GITHUB_ENV | |
echo "GHA_Matlab_MEX_EXTENSION=mexw64" >> $GITHUB_ENV | |
- name: Dependencies [Conda] | |
shell: bash -l {0} | |
run: | | |
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186 | |
conda config --remove channels defaults | |
# Compilation related dependencies | |
mamba install cmake compilers make ninja pkg-config | |
# YARP dependencies | |
mamba install ace eigen ycm-cmake-modules | |
# Uncomment when we are compatible with releases in conda yarp | |
# mamba install yarp | |
- name: Install YARP [Conda/Linux&macOS] | |
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') | |
shell: bash -l {0} | |
run: | | |
git clone https://github.com/robotology/yarp | |
cd yarp | |
mkdir build | |
cd build | |
cmake -GNinja -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DYARP_COMPILE_EXECUTABLES:BOOL=OFF .. | |
cmake --build . --config ${{ matrix.build_type }} | |
cmake --install . --config ${{ matrix.build_type }} | |
- name: Install YARP [Conda/Windows] | |
if: contains(matrix.os, 'windows') | |
shell: bash -l {0} | |
run: | | |
git clone https://github.com/robotology/yarp | |
cd yarp | |
mkdir build | |
cd build | |
cmake -G"Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}/Library -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DYARP_COMPILE_EXECUTABLES:BOOL=OFF .. | |
cmake --build . --config ${{ matrix.build_type }} | |
cmake --install . --config ${{ matrix.build_type }} | |
- 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 -DYARP_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} .. | |
- 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 -DYARP_USES_MATLAB:BOOL=ON -DMatlab_ROOT_DIR=${GHA_Matlab_ROOT_DIR} -DMatlab_MEX_EXTENSION:STRING=${GHA_Matlab_MEX_EXTENSION} .. | |
- name: Build [Conda] | |
shell: bash -l {0} | |
run: | | |
cd build | |
cmake --build . --config ${{ matrix.build_type }} | |
- name: Inspect libraries linked by yarpMEX.mexa64 [Conda/Linux] | |
if: contains(matrix.os, 'ubuntu') | |
shell: bash -l {0} | |
run: | | |
cd build | |
ldd ./matlab/yarpMEX.mexa64 | |
- name: Install [Conda] | |
shell: bash -l {0} | |
run: | | |
cd build | |
cmake --install . --config ${{ matrix.build_type }} | |