-
Notifications
You must be signed in to change notification settings - Fork 5
110 lines (98 loc) · 4.2 KB
/
regenerate-matlab-bindings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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 }}"