-
Notifications
You must be signed in to change notification settings - Fork 0
343 lines (283 loc) · 12.4 KB
/
tests.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
name: Run C++ comparison tests
on:
workflow_dispatch:
env:
iDynTree_TAG: 4aabb8525e95af161e916a8dfb85fbf994bb7aeb
coinbrew_TAG: cc905f64c39ebe430dd80d28b3d17207e04bf01d
ipopt_TAG: 641f2202f5594018ab0ebee6d1b7c6853ef83343
MUMPS_TAG: 2fc1a186fa118eccfeb76657424d43063b67b393
ASL_TAG: d9e058561ec67b1440761f64fa94e28a6078fe95
HSL_TAG: 972b202b6d01c39221fe6fbe90f42779edf70e49
matiocpp_TAG: ed9b196360b8083c3eccd3348afa7969d3a4f1fa
dynamical_planner_TAG: 09efc88679ab7a1cd8c94485c347870be63b8ebe
jobs:
build:
name: 'Build'
runs-on: ubuntu-20.04
steps:
- name: Display 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
- name: Remove broken apt repos
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# ============
# DEPENDENCIES
# ============
- name: System dependencies
run: |
sudo apt update
# IPOPT dependencies
sudo apt install make git wget tar patch dos2unix pkg-config gfortran liblapack-dev libblas-dev libopenblas-dev libmetis-dev
# iDyntree dependencies
sudo apt-get install build-essential cmake libeigen3-dev libxml2-dev libassimp-dev libirrlicht-dev
#matioCpp dependencies
sudo apt install libmatio-dev
#FFMPEG dependencies
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libswscale-dev libpostproc-dev
#Xvfb, just to have a dummy screen
sudo apt install xvfb
#To zip the SavedVideos folder
sudo apt install zip unzip
- name: Create common build and install folder
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}
mkdir cpp_ws
cd cpp_ws
mkdir -p build/install
- name: Coinbrew and Ipopt fetching
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}/cpp_ws
mkdir coin-or
cd coin-or
#coinbrew
git clone https://github.com/coin-or/coinbrew
cd coinbrew/
git reset ${coinbrew_TAG} --hard
chmod u+x coinbrew
#Manually fetching IPOPT and ThirdParty deps
cd ../
git clone https://github.com/coin-or/Ipopt
cd Ipopt/
git checkout -b master
git reset ${ipopt_TAG} --hard
cd ../
mkdir ThirdParty
cd ThirdParty/
#Mumps
git clone https://github.com/coin-or-tools/ThirdParty-Mumps Mumps
cd Mumps/
git checkout -b stable/2.1
git reset ${MUMPS_TAG} --hard
./get.Mumps
touch .build #Otherwise coinbrew will skip its installations
cd ../
#ASL
git clone https://github.com/coin-or-tools/ThirdParty-ASL ASL
cd ASL/
git checkout -b stable/2.0
git reset ${ASL_TAG} --hard
./get.ASL
cd ../
#HSL
git clone https://github.com/coin-or-tools/ThirdParty-HSL HSL
cd HSL/
git checkout -b stable/2.1
git reset ${HSL_TAG} --hard
- name: IPOPT installation
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}/cpp_ws/coin-or
coinbrew/coinbrew fetch Ipopt --no-prompt --skip-update
coinbrew/coinbrew build Ipopt -b ${GITHUB_WORKSPACE}/cpp_ws/build/ipopt --prefix=${GITHUB_WORKSPACE}/cpp_ws/build/install/ --no-prompt --tests none --verbosity=3 ADD_CFLAGS=-fopenmp ADD_FFLAGS=-fopenmp ADD_CXXFLAGS=-fopenmp
- name: matioCpp installation
shell: bash -l {0}
run: |
cd ${GITHUB_WORKSPACE}/cpp_ws
git clone https://github.com/ami-iit/matio-cpp
cd matio-cpp
git checkout ${matiocpp_TAG}
cd ${GITHUB_WORKSPACE}/cpp_ws/build
mkdir matio-cpp && cd matio-cpp
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/cpp_ws/build/install -DCMAKE_BUILD_TYPE=Release ${GITHUB_WORKSPACE}/cpp_ws/matio-cpp
make install
- name: iDynTree installation
shell: bash -l {0}
run: |
export IPOPT_DIR=${GITHUB_WORKSPACE}/cpp_ws/build/install
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${IPOPT_DIR}/lib/pkgconfig/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${IPOPT_DIR}/lib
cd ${GITHUB_WORKSPACE}/cpp_ws
git clone https://github.com/robotology/idyntree
cd idyntree
git checkout ${iDynTree_TAG}
cd ${GITHUB_WORKSPACE}/cpp_ws/build
mkdir idyntree && cd idyntree
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/cpp_ws/build/install -DCMAKE_BUILD_TYPE=Release -DIDYNTREE_USES_IRRLICHT:BOOL=ON ${GITHUB_WORKSPACE}/cpp_ws/idyntree
make install
- name: Dynamical Planner Installation
shell: bash -l {0}
run: |
export IPOPT_DIR=${GITHUB_WORKSPACE}/cpp_ws/build/install
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${IPOPT_DIR}/lib/pkgconfig/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${IPOPT_DIR}/lib
cd ${GITHUB_WORKSPACE}/cpp_ws
git clone https://github.com/ami-iit/dynamical-planner
cd dynamical-planner
git checkout ${dynamical_planner_TAG}
cd ${GITHUB_WORKSPACE}/cpp_ws/build
mkdir dynamical-planner && cd dynamical-planner
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/cpp_ws/build/install -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/cpp_ws/build/install -DBUILD_TESTING:BOOL=ON ${GITHUB_WORKSPACE}/cpp_ws/dynamical-planner
make
- name: Zip cpp_ws folder
shell: bash
run: |
zip -r cpp_ws.zip cpp_ws/
- uses: actions/upload-artifact@v3
with:
name: cpp_ws
path: cpp_ws.zip
test-different-parameter:
name: 'Test with different parameters'
needs: build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
complementarity: [dynamical, classical, hyperbolic]
velocity: [0.05, 0.06, 0.07]
normalForceDissipationRatio: [250.0]
normalForceHyperbolicSecantScaling: [500.0]
complementarityDissipation: [20.0]
dynamicComplementarityUpperBound: [0.05]
classicalComplementarityTolerance: [0.004]
include:
- complementarity: dynamical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 10.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.004
- complementarity: dynamical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 10.0
dynamicComplementarityUpperBound: 0.1
classicalComplementarityTolerance: 0.004
- complementarity: dynamical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.1
classicalComplementarityTolerance: 0.004
- complementarity: classical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.008
- complementarity: classical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.012
- complementarity: classical
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.016
- complementarity: hyperbolic
velocity: 0.05
normalForceDissipationRatio: 125.0
normalForceHyperbolicSecantScaling: 400.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.004
- complementarity: hyperbolic
velocity: 0.05
normalForceDissipationRatio: 125.0
normalForceHyperbolicSecantScaling: 500.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.004
- complementarity: hyperbolic
velocity: 0.05
normalForceDissipationRatio: 250.0
normalForceHyperbolicSecantScaling: 400.0
complementarityDissipation: 20.0
dynamicComplementarityUpperBound: 0.05
classicalComplementarityTolerance: 0.004
steps:
# 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
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# Even if we download the build folder, we still have to install the system dependencies
- name: System dependencies
run: |
sudo apt update
# IPOPT dependencies
sudo apt install make git wget tar patch dos2unix pkg-config gfortran liblapack-dev libblas-dev libopenblas-dev libmetis-dev
# iDyntree dependencies
sudo apt-get install build-essential cmake libeigen3-dev libxml2-dev libassimp-dev libirrlicht-dev
#matioCpp dependencies
sudo apt install libmatio-dev
#FFMPEG dependencies
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavdevice-dev libavfilter-dev libswscale-dev libpostproc-dev
#Xvfb, just to have a dummy screen
sudo apt install xvfb
#To zip the SavedVideos folder
sudo apt install zip unzip
- name: Download cpp_ws folder
uses: actions/download-artifact@v3
with:
name: cpp_ws
- name: Unzip cpp_ws
shell: bash
run: |
unzip cpp_ws.zip
- name: Test
shell: bash
run: |
cd cpp_ws/build/dynamical-planner/bin
OMP_NUM_THREADS=1 xvfb-run ./SolverForComparisonsUnitTest --complementarity ${{ matrix.complementarity }} \
--velocity ${{ matrix.velocity }} \
--normalForceDissipationRatio ${{ matrix.normalForceDissipationRatio }} \
--normalForceHyperbolicSecantScaling ${{ matrix.normalForceHyperbolicSecantScaling }} \
--complementarityDissipation ${{ matrix.complementarityDissipation }} \
--dynamicComplementarityUpperBound ${{ matrix.dynamicComplementarityUpperBound }} \
--classicalComplementarityTolerance ${{ matrix.classicalComplementarityTolerance }}
- name: Zip SavedVideos
shell: bash
run: |
cd cpp_ws/build/dynamical-planner
zip -r SavedVideos.zip SavedVideos
- uses: actions/upload-artifact@v3
if: matrix.complementarity == 'dynamical'
with:
name: SavedVideos-${{ matrix.complementarity }}_v${{ matrix.velocity }}_ub${{ matrix.dynamicComplementarityUpperBound }}_K${{ matrix.complementarityDissipation }}
path: cpp_ws/build/dynamical-planner/SavedVideos.zip
- uses: actions/upload-artifact@v3
if: matrix.complementarity == 'classical'
with:
name: SavedVideos-${{ matrix.complementarity }}_v${{ matrix.velocity }}_K${{ matrix.classicalComplementarityTolerance }}
path: cpp_ws/build/dynamical-planner/SavedVideos.zip
- uses: actions/upload-artifact@v3
if: matrix.complementarity == 'hyperbolic'
with:
name: SavedVideos-${{ matrix.complementarity }}_v${{ matrix.velocity }}_sec${{ matrix.normalForceHyperbolicSecantScaling }}_K${{ matrix.normalForceDissipationRatio }}
path: cpp_ws/build/dynamical-planner/SavedVideos.zip