-
Notifications
You must be signed in to change notification settings - Fork 28
239 lines (212 loc) · 10.4 KB
/
ci.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
name: C++ CI Workflow
# template derived from https://github.com/robotology/how-to-export-cpp-library/tree/master/.github/workflows
# and https://github.com/robotology/idyntree/blob/master/.github/workflows/ci.yml
on:
push:
pull_request:
schedule:
# run a cron job for a nightly build
# * 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.6.0
YCM_TAG: v0.14.2
YARP_TAG: v3.7.2
iDynTree_TAG: v6.0.0
wearables_TAG: v1.4.0
icub_main_TAG: v1.28.1
osqp_TAG: v0.6.0
OsqpEigen_TAG: v0.6.2
matioCpp_TAG: v0.2.0
robometry_TAG: v1.2.0
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by Github Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg
jobs:
build:
name: '[${{matrix.os}}@${{matrix.build_type}}]'
runs-on: ${{matrix.os}}
strategy:
matrix:
build_type: [Release]
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
steps:
# Clone the repository in $GITHUB_WORKSPACE
- uses: actions/checkout@master
# Use conda for Windows dependencies
- uses: conda-incubator/setup-miniconda@v2
if: contains(matrix.os, 'windows')
with:
mamba-version: "*"
channels: conda-forge,robotology,defaults
channel-priority: true
environment: human-dynamics-estimation
python-version: 3.8
# Print the environment variables to simplify development and debugging
- name: Environment Variables
# Use bash in order to have same basic commands in all OSs
shell: bash
run: env
# Remove apt repos on Ubuntu 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: matrix.os == 'ubuntu-latest'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# ============
# DEPENDENCIES
# ============
- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ccache eigen ace tinyxml gsl irrlicht libmatio boost
- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt 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 libqt5charts5-dev \
libxml2-dev liburdfdom-dev libtinyxml-dev liburdfdom-dev liboctave-dev python3-dev valgrind libassimp-dev libirrlicht-dev libmatio-dev
- name: Cache Source-based dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macOS'))
id: cache-source-deps
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/install/deps
# Including ${{ runner.temp }} is a workaround for https://github.com/robotology/whole-body-estimators/issues/60
key: source-deps-${{runner.os}}-${{runner.temp}}-vcpkg-robotology-${{env.vcpkg_robotology_TAG}}-ycm-${{env.YCM_TAG}}-yarp-${{env.YARP_TAG}}-iDynTree-${{env.iDynTree_TAG}}-wearables-${{env.wearables_TAG}}-icub_main-${{env.icub_main_TAG}}-OsqpEigen-${{env.OsqpEigen_TAG}}-matioCpp-${{env.matioCpp_TAG}}-robometry-${{env.robometry_TAG}}
- name: Dependencies (using conda) [Windows]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install yarp icub-main wearables idyntree matio-cpp robometry osqp-eigen
- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest')
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 -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# 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 ..
cmake --build . --config ${{matrix.build_type}} --target install
# icub-main
cd ${GITHUB_WORKSPACE}
git clone -b ${icub_main_TAG} https://github.com/robotology/icub-main
cd icub-main
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# 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 \
-DIDYNTREE_USES_IRRLICHT:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# wearables
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/wearables
cd wearables
git checkout ${wearables_TAG}
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# osqp
cd ${GITHUB_WORKSPACE}
git clone --recursive -b ${osqp_TAG} https://github.com/oxfordcontrol/osqp
cd osqp
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install
# OsqpEigen
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_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# matioCpp
cd ${GITHUB_WORKSPACE}
git clone https://github.com/dic-iit/matio-cpp
cd matio-cpp
git checkout ${matioCpp_TAG}
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# robometry
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/robometry
cd robometry
git checkout ${robometry_TAG}
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install
# ===================
# CMAKE-BASED PROJECT
# ===================
# We will just configure and build the project now. Further modifications and tests can be added
# Configure step
- name: Configure [Windows]
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -A x64 cmake -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON \
-DHUMANSTATEPROVIDER_ENABLE_LOGGER:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Configure [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
run: |
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON \
-DHUMANSTATEPROVIDER_ENABLE_LOGGER:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
# Build step
- 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:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/install/x64-windows/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/debug/bin
cmake --build . --config ${{matrix.build_type}}