-
Notifications
You must be signed in to change notification settings - Fork 36
226 lines (224 loc) · 9.45 KB
/
build.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
name: CI of mc_rtc
on:
push:
paths-ignore:
# Changes to those files don't mandate running CI
- ".gitlab-ci.yml"
- ".jrl-ci"
- ".github/workflows/package.yml"
- ".github/workflows/sources/*"
- ".github/workflows/build-others.yml"
- ".github/workflows/docker/*"
- "debian/**"
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
build-type: [Debug, RelWithDebInfo, script]
compiler: [gcc, clang]
exclude:
# Only default compiler on ubuntu-18.04, macos-latest and windows-latest
- os: ubuntu-18.04
compiler: clang
- os: macos-latest
compiler: clang
- os: windows-latest
compiler: clang
# Script always use default compiler
- build-type: script
compiler: clang
# FIXME Windows Debug CI fails: tests are failing
- os: windows-latest
build-type: Debug
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Linux cleanup
if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04'
run: |
set -e
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /usr/local/lib/android
echo "LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/x86_64-linux-gnu/:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: macOS cleanup
run: |
sudo rm '/usr/local/bin/2to3'
if: startsWith(runner.os, 'macOS')
- name: Install pip for Python 2 (Ubuntu 20.04)
run: |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
sudo python2 get-pip.py
rm -f get-pip.py
if: matrix.os == 'ubuntu-20.04' && matrix.build-type != 'script'
- name: Clear environment (script)
uses: jrl-umi3218/github-actions/install-dependencies@master
if: matrix.build-type == 'script'
with:
compiler: ${{ matrix.compiler }}
build-type: RelWithDebInfo
- name: Build with script
if: matrix.build-type == 'script'
shell: bash
run: |
set -x
cd utils
if [[ "${{ matrix.os }}" == "windows-latest" ]]
then
./build_and_install.sh --user-input false --with-python-support false --build-testing false --build-benchmarks true
elif [[ "${{ matrix.os }}" == "macos-latest" ]]
then
./build_and_install.sh --user-input false --with-python-support false --build-benchmarks true --allow-root true
else
./build_and_install.sh --user-input false --build-benchmarks true --allow-root true
fi
- name: Install dependencies
uses: jrl-umi3218/github-actions/install-dependencies@master
if: matrix.build-type != 'script'
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
ubuntu: |
apt: cython cython3 python-pytest python3-pytest python-numpy python3-numpy python-coverage python3-coverage python-setuptools python3-setuptools libeigen3-dev doxygen doxygen-latex libboost-all-dev libtinyxml2-dev libgeos++-dev libnanomsg-dev libyaml-cpp-dev libltdl-dev libnotify-dev
macos: |
brew: eigen boost tinyxml2 geos nanomsg yaml-cpp pkg-config libtool gcc libnotify
pip: Cython coverage numpy pytest
windows: |
pip: Cython coverage numpy pytest
github:
- path: eigenteam/eigen-git-mirror
ref: 3.3.7
- path: leethomason/tinyxml2
ref: 7.1.0
- path: libgeos/geos
ref: 3.8.1
options: -DBUILD_TESTING:BOOL=ON
- path: nanomsg/nanomsg
ref: 1.1.5
- path: jbeder/yaml-cpp
ref: 29dcf92f870ee51cce8d68f8fcfe228942e8dfe1
options: -DYAML_CPP_BUILD_TESTS:BOOL=OFF
macos-options: -DPYTHON_BINDING:BOOL=OFF
windows-options: -DPYTHON_BINDING:BOOL=OFF
github: |
- path: gabime/spdlog
ref: v1.6.1
options: -DSPDLOG_BUILD_EXAMPLE:BOOL=OFF -DSPDLOG_BUILD_SHARED:BOOL=ON
- path: loco-3d/ndcurves
ref: v1.1.5
options: -DBUILD_PYTHON_INTERFACE:BOOL=OFF
- path: jrl-umi3218/Eigen3ToPython
- path: jrl-umi3218/SpaceVecAlg
- path: jrl-umi3218/sch-core
options: -DCMAKE_CXX_STANDARD=11
- path: jrl-umi3218/eigen-qld
- path: jrl-umi3218/sch-core-python
- path: jrl-umi3218/RBDyn
- path: jrl-umi3218/Tasks
- path: jrl-umi3218/mc_rbdyn_urdf
- path: jrl-umi3218/jvrc_description
options: -DDISABLE_ROS:BOOL=ON
- path: jrl-umi3218/mc_env_description
options: -DDISABLE_ROS:BOOL=ON
- path: jrl-umi3218/mc_int_obj_description
options: -DDISABLE_ROS:BOOL=ON
- path: jrl-umi3218/eigen-quadprog
- path: jrl-umi3218/state-observation
- path: jrl-umi3218/tvm
options: -DTVM_WITH_ROBOT:BOOL=OFF
- name: Build and test
if: matrix.build-type == 'RelWithDebInfo' || (matrix.build-type == 'Debug' && github.ref == 'refs/heads/master')
uses: jrl-umi3218/github-actions/build-cmake-project@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
macos-options: -DPYTHON_BINDING:BOOL=OFF
windows-options: -DPYTHON_BINDING:BOOL=OFF
- name: Build and test (Debug/Fast tests)
if: matrix.build-type == 'Debug' && github.ref != 'refs/heads/master'
uses: jrl-umi3218/github-actions/build-cmake-project@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
options: '-DENABLE_FAST_TESTS:BOOL=ON'
macos-options: -DPYTHON_BINDING:BOOL=OFF
- name: Build with ROS
if: (matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04') && matrix.build-type != 'script'
run: |
set -e
set -x
pushd .
if [ "${{ matrix.os }}" = "ubuntu-18.04" ]
then
export ROS_DISTRO="melodic"
else
export ROS_DISTRO="noetic"
fi
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get install -qq ros-${ROS_DISTRO}-ros-base ros-${ROS_DISTRO}-tf2-ros
. /opt/ros/${ROS_DISTRO}/setup.bash
mkdir -p /tmp/_ci/catkin_ws/src/
cd /tmp/_ci/catkin_ws/src
catkin_init_workspace
git clone --recursive https://github.com/jrl-umi3218/mc_rtc_msgs
cd ../
catkin_make || exit 1
. devel/setup.bash
popd
pushd .
cd build
cmake ../ && make -j2 && sudo make install || exit 1
popd
- name: Upload documentation
# Only run on master branch and for one configuration
if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.compiler == 'gcc' && github.ref == 'refs/heads/master' && github.repository == 'jrl-umi3218/mc_rtc'
run: |
set -x
pushd .
cd doc
cp -r /usr/local/share/doc/mc_rtc/doxygen-html .
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/SpaceVecAlg/doxygen-html/@https://jrl-umi3218.github.io/SpaceVecAlg/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/RBDyn/doxygen-html/@https://jrl-umi3218.github.io/RBDyn/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/Tasks/doxygen-html/@https://jrl-umi3218.github.io/Tasks/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/sch-core/doxygen-html/@https://jrl-umi3218.github.io/sch-core/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/mc_rbdyn_urdf/doxygen-html/@https://jrl-umi3218.github.io/mc_rbdyn_urdf/doxygen/HEAD/@g'
find . -type f -print0 | xargs -0 sed -i -e's@/usr/local/share/doc/TVM/doxygen-html/@https://jrl-umi3218.github.io/tvm/doxygen/HEAD/@g'
sudo apt-get install -qq ruby-dev ruby-bundler libxml2-dev
bundle install --path vendor
git clone -b gh-pages https://gergondet:${{ secrets.GH_PAGES_TOKEN }}@github.com/jrl-umi3218/mc_rtc /tmp/website
bundle exec jekyll build --trace -b /mc_rtc -d /tmp/website
cd /tmp/website
git add .
git config --global user.email "[email protected]"
git config --global user.name "Pierre Gergondet (Automated CI update)"
git commit -m "Website from commit ${GITHUB_SHA}"
git push origin gh-pages
popd
- name: Debug Windows DLL issue
if: failure() && matrix.os == 'windows-latest'
shell: bash
run: |
set -e
pwd
echo $PATH
ls
ldd build/tests/RelWithDebInfo/testGUIStateBuilder.exe
ldd build/tests/RelWithDebInfo/testDataStore.exe
- name: Slack Notification
if: failure()
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: '#ci'
slack-text: >
[mc_rtc] Build *${{ matrix.os }}/${{ matrix.build-type }} (${{ matrix.compiler }})* failed on ${{ github.ref }}