-
Notifications
You must be signed in to change notification settings - Fork 11
212 lines (198 loc) · 11.1 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
name: CI Workflow
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'feat/**'
- 'fix/**'
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:
name: '[${{ matrix.os }}@${{ matrix.build_type }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release]
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@main
- name: Display environment variables
shell: bash
run: env
# ============
# DEPENDENCIES
# ============
- name: Download Vcpkg Prebuilt Dependencies [Windows]
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$response = gh api --paginate -H "Accept: application/vnd.github.v3+json" /repos/robotology/robotology-superbuild-dependencies-vcpkg/releases/latest
$latest_tag = ($response | ConvertFrom-Json).tag_name
echo "Installing robotology-superbuild-dependencies-vcpkg@$latest_tag"
iwr -Uri https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/$latest_tag/vcpkg-robotology.zip -OutFile C:/vcpkg-robotology.zip
7z x C:/vcpkg-robotology.zip -oC:/
"VCPKG_INSTALLATION_ROOT=C:/robotology/vcpkg" >> $env:GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Vcpkg Dependencies [Windows]
if: matrix.os == 'windows-latest'
shell: bash
run: |
${VCPKG_INSTALLATION_ROOT}/vcpkg.exe install --overlay-ports=C:/robotology/robotology-vcpkg-ports --recurse --triplet x64-windows fftw3
- name: Install Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y git build-essential pkg-config zip unzip zlib1g-dev cmake libace-dev coinor-libipopt-dev libeigen3-dev swig \
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libtinyxml-dev libgsl-dev libmatio-dev fftw3 wget curl autoconf \
autogen automake libtool mlocate python3 python3-numpy python3-dev python3-pip python3-wheel libglvnd-dev
# install Bazel 0.26.1 needed by tensorflow_cc
#wget https://github.com/bazelbuild/bazel/releases/download/0.26.1/bazel_0.26.1-linux-x86_64.deb
#sudo dpkg -i bazel_0.26.1-linux-x86_64.deb
- name: Determine YCM and YARP versions required by ICUB
shell: bash
run: |
cd ${GITHUB_WORKSPACE}
if [ "$RUNNER_OS" == "Windows" ]; then
choco install wget
fi
wget -O CMakeLists.txt.icub-main https://raw.githubusercontent.com/robotology/icub-main/devel/CMakeLists.txt
grep -m 1 YCM_REQUIRED_VERSION CMakeLists.txt.icub-main | sed "s/[^0-9.]//g" >> YCM_VERSION.txt
grep -m 1 YARP_REQUIRED_VERSION CMakeLists.txt.icub-main | sed "s/[^0-9.]//g" >> YARP_VERSION.txt
echo "ycm_version=$(cat YCM_VERSION.txt)" >> $GITHUB_ENV
echo "yarp_version=$(cat YARP_VERSION.txt)" >> $GITHUB_ENV
- name: Build Source-based Dependencies [Windows]
if: matrix.os == 'windows-latest'
shell: bash
run: |
# ycm
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/ycm.git --depth 1 --branch v${{ env.ycm_version }}
cd ycm && mkdir -p build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target INSTALL
# yarp
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp.git --depth 1 --branch v${{ env.yarp_version }}
cd yarp && mkdir -p build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target INSTALL
# icub-main
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-main.git --depth 1 --branch devel
cd icub-main && mkdir -p build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_icubmod_cartesiancontrollerserver=ON -DENABLE_icubmod_cartesiancontrollerclient=ON \
-DENABLE_icubmod_gazecontrollerclient=ON ..
cmake --build . --config ${{ matrix.build_type }} --target INSTALL
# cer
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/cer.git --depth 1 --branch devel
cd cer && mkdir -p build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target INSTALL
# icub-contrib-common
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-contrib-common.git --depth 1
cd icub-contrib-common && mkdir -p build && cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target INSTALL
- name: Build Source-based Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
# opencv
cd ${GITHUB_WORKSPACE}
git clone https://github.com/opencv/opencv.git --depth 1 --branch 4.6.0
git clone https://github.com/opencv/opencv_contrib.git --depth 1 --branch 4.6.0
cd opencv && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DOPENCV_EXTRA_MODULES_PATH=${GITHUB_WORKSPACE}/opencv_contrib/modules \
-DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# vtk
cd ${GITHUB_WORKSPACE}
git clone https://github.com/Kitware/VTK.git --depth 1 --branch v9.2.2
cd VTK && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# tensorflow_cc
#cd ${GITHUB_WORKSPACE}
#git clone https://github.com/FloopCZ/tensorflow_cc.git --depth 1 --branch master
#cd tensorflow_cc/tensorflow_cc && mkdir -p build && cd build
#cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DTENSORFLOW_STATIC=OFF -DTENSORFLOW_SHARED=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
#cmake --build . --config ${{ matrix.build_type }} --target install
# ycm
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/ycm.git --depth 1 --branch v${{ env.ycm_version }}
cd ycm && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# yarp
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp.git --depth 1 --branch v${{ env.yarp_version }}
cd yarp && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# icub-main
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-main.git --depth 1 --branch devel
cd icub-main && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DENABLE_icubmod_cartesiancontrollerserver=ON -DENABLE_icubmod_cartesiancontrollerclient=ON -DENABLE_icubmod_gazecontrollerclient=ON ..
cmake --build . --config ${{ matrix.build_type }} --target install
# cer
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/cer.git --depth 1 --branch devel
cd cer && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# icub-contrib-common
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/icub-contrib-common.git --depth 1
cd icub-contrib-common && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# ===================
# CMAKE-BASED PROJECT
# ===================
- name: Configure [Windows]
if: matrix.os == 'windows-latest'
shell: bash
run: |
mkdir -p build
cd build
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_TESTING=ON ..
- name: Configure [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_TESTING=ON ..
- name: Build
shell: bash
run: |
cd build
# Fix for using YARP idl generators (that link ACE) in Windows
# See https://github.com/robotology/idyntree/issues/569 for more details
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/bin
cmake --build . --config ${{ matrix.build_type }}
- name: Install
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install