Regenerate MATLAB bindings #39
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: Regenerate MATLAB bindings | |
# This action regenerates the MATLAB bindings, for more details | |
# see doc/dev/faqs.md#how-to-add-wrap-a-new-class-or-function-with-swig | |
on: | |
workflow_dispatch: | |
jobs: | |
regenerate-matlab-bindings: | |
name: "Regenerate MATLAB bindings" | |
runs-on: [ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install SWIG for that supports MATLAB | |
run: | | |
sudo apt-get remove swig swig4.0 | |
cd .. | |
git clone https://github.com/KrisThielemans/swig | |
cd swig | |
git checkout matlab-update | |
sh autogen.sh | |
./configure --with-matlab | |
make | |
sudo make install | |
- name: Verify which SWIG is found | |
run: | | |
which swig | |
swig --help | |
- name: Git branch name | |
id: git-branch-name | |
uses: EthanSK/git-branch-name-action@v1 | |
- name: Configure and compile YARP | |
run: | | |
# Install YARP dependencies | |
sudo apt-get update | |
sudo apt-get install build-essential git cmake cmake-curses-gui libeigen3-dev libace-dev libedit-dev libsqlite3-dev \ | |
libtinyxml-dev qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev \ | |
qml-module-qtquick2 qml-module-qtquick-window2 \ | |
qml-module-qtmultimedia qml-module-qtquick-dialogs \ | |
qml-module-qtquick-controls qml-module-qt-labs-folderlistmodel \ | |
qml-module-qt-labs-settings libqcustomplot-dev libgraphviz-dev \ | |
libjpeg-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \ | |
gstreamer1.0-libav liboctave-dev | |
# Clone YCM | |
git clone https://github.com/robotology/ycm -b v0.16.1 | |
cd ycm | |
mkdir build | |
cd build | |
cmake .. | |
make | |
sudo make install | |
cd ../.. | |
# Clone YARP | |
git clone https://github.com/robotology/yarp -b ${GIT_BRANCH_NAME} | |
# Configure, build and install YARP and regenerate yarp-matlab-bindings | |
cd yarp | |
mkdir build | |
cd build | |
cmake -DYARP_COMPILE_EXECUTABLES:BOOL=OFF .. | |
make | |
sudo make install | |
# Configure yarp-matlab-bindings | |
cd ../.. | |
# Remove autogenerate files to ensure that removed files are actually removed | |
git rm -r matlab/autogenerated | |
# Workaround for https://github.com/robotology/yarp-matlab-bindings/issues/18 | |
touch yarp/bindings/yarp.i | |
mkdir -p build | |
cd build | |
cmake -DYARP_SOURCE_DIR:PATH=${GITHUB_WORKSPACE}/yarp -DYARP_USES_OCTAVE:BOOL=ON -DYARP_GENERATE_MATLAB:BOOL=ON .. | |
cat CMakeCache.txt | |
make | |
cd .. | |
# After bindings are generated, we modify the names of generic files to avoid conflicts with CasADi | |
./fix_generic_names_in_autogenerated_files.sh | |
git add matlab/autogenerated | |
# Remove build directory and yarp directory to avoid them being committed | |
rm -r ycm | |
rm -r yarp | |
rm -r build | |
- name: Check local changes due to bindings generation | |
run: | | |
git status | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: 'update matlab bindings' | |
committer: GitHub <[email protected]> | |
branch: regenerate-matlab-bindings-${{ env.GIT_BRANCH_NAME }} | |
delete-branch: true | |
title: 'update matlab bindings' | |
body: | | |
This is a PR that regenerated the MATLAB/Octave YARP bindings. | |
For more info, check the [documentation on MATLAB bindings](https://github.com/robotology/yarp-matlab-bindings). | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |