forked from isri-aist/LocomanipController
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (196 loc) · 8.16 KB
/
ci.yaml
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
name: Build and test
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
schedule:
- cron: '0 0 * * 0'
jobs:
clang-format:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Install clang-format-10
run: |
sudo apt-get -y -qq update
sudo apt-get -y -qq install clang-format-10
- name: Run clang-format-check
run: |
./.clang-format-check.sh
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
build-type: [RelWithDebInfo, Debug]
mc-rtc-version: [head, stable]
exclude:
- build-type: Debug
mc-rtc-version: stable
runs-on: ${{ matrix.os }}
steps:
- name: Set ROS version
run: |
if [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then
echo "ROS_DISTRO=noetic" >> $GITHUB_ENV
echo "PYTHON_PACKAGE_PREFIX=python3" >> $GITHUB_ENV
else
echo "ROS_DISTRO=melodic" >> $GITHUB_ENV
echo "PYTHON_PACKAGE_PREFIX=python" >> $GITHUB_ENV
fi
- name: Install ROS
run: |
set -e
set -x
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 -y -qq
sudo apt-get install -y -qq ros-${ROS_DISTRO}-ros-base ${PYTHON_PACKAGE_PREFIX}-catkin-tools ${PYTHON_PACKAGE_PREFIX}-rosdep doxygen graphviz
- name: Install mc_rtc
run: |
set -e
set -x
curl -1sLf 'https://dl.cloudsmith.io/public/mc-rtc/${{ matrix.mc-rtc-version }}/setup.deb.sh' | sudo -E bash
sudo apt install -y -qq libmc-rtc-dev mc-rtc-utils ros-${ROS_DISTRO}-mc-rtc-plugin libeigen-qld-dev
- name: Setup catkin workspace
run: |
mkdir -p ${GITHUB_WORKSPACE}/catkin_ws/src/
cd ${GITHUB_WORKSPACE}/catkin_ws
set +x
. /opt/ros/${ROS_DISTRO}/setup.bash
set -x
catkin init
catkin build --limit-status-rate 0.1
- name: Checkout repository code
uses: actions/checkout@v3
with:
submodules: recursive
path: catkin_ws/src/isri-aist/LocomanipController
- name: Checkout QpSolverCollection
uses: actions/checkout@v3
with:
repository: isri-aist/QpSolverCollection
submodules: recursive
path: catkin_ws/src/isri-aist/QpSolverCollection
- name: Checkout NMPC
uses: actions/checkout@v3
with:
repository: isri-aist/NMPC
submodules: recursive
path: catkin_ws/src/isri-aist/NMPC
- name: Checkout CentroidalControlCollection
uses: actions/checkout@v3
with:
repository: isri-aist/CentroidalControlCollection
submodules: recursive
path: catkin_ws/src/isri-aist/CentroidalControlCollection
- name: Checkout BaselineWalkingController
uses: actions/checkout@v3
with:
repository: isri-aist/BaselineWalkingController
submodules: recursive
path: catkin_ws/src/isri-aist/BaselineWalkingController
- name: Rosdep install
run: |
set -e
set -x
cd ${GITHUB_WORKSPACE}/catkin_ws
set +x
. devel/setup.bash
set -x
sudo rosdep init
rosdep update
rosdep install -y -r --from-paths src --ignore-src
- name: Catkin build
run: |
set -e
set -x
cd ${GITHUB_WORKSPACE}/catkin_ws
set +x
. devel/setup.bash
set -x
catkin build locomanip_controller --limit-status-rate 0.1 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_QLD=ON -DINSTALL_DOCUMENTATION=ON
# - name: Run tests
# run: |
# set -e
# set -x
# cd ${GITHUB_WORKSPACE}/catkin_ws
# set +x
# . devel/setup.bash
# set -x
# catkin build --limit-status-rate 0.1 --catkin-make-args run_tests -- locomanip_controller --no-deps
# catkin_test_results --verbose --all build
# - name: Run simulation
# # Only run for one configuration
# if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.mc-rtc-version == 'head'
# # https://github.com/jrl-umi3218/lipm_walking_controller/blob/b564d655388ae6a6725c504e5c74a62192e58c7c/.github/workflows/build.yml#L64-L92
# run: |
# set -e
# set -x
# sudo apt-get install -y -qq jvrc-choreonoid xvfb ffmpeg mesa-utils fluxbox xserver-xorg xserver-xorg-core xserver-xorg-video-all libwayland-egl1-mesa
# set +x
# . ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash
# set -x
# export DISPLAY=":1"
# Xvfb ${DISPLAY} -screen 0 1920x1080x24 &
# sleep 10s
# fluxbox 2> /dev/null &
# mkdir -p ${HOME}/.config/mc_rtc/controllers
# cp ${GITHUB_WORKSPACE}/catkin_ws/src/isri-aist/LocomanipController/etc/mc_rtc.yaml ${HOME}/.config/mc_rtc
# cp ${GITHUB_WORKSPACE}/catkin_ws/src/isri-aist/LocomanipController/.github/workflows/config/WalkingOnPlane.yaml ${HOME}/.config/mc_rtc/controllers/LocomanipController.yaml
# ffmpeg -y -f x11grab -s 1920x1080 -r 30 -i ${DISPLAY} -qscale 0 -vcodec huffyuv /tmp/video.avi > /dev/null 2>&1 < /dev/null &
# FFMPEG_PID=$!
# cd /usr/share/hrpsys/samples/JVRC1
# ./clear-omninames.sh
# choreonoid --start-simulation sim_mc.cnoid &
# CNOID_PID=$!
# sleep 40s
# kill -2 ${CNOID_PID}
# kill -2 ${FFMPEG_PID}
# sleep 10s
# mkdir -p /tmp/results
# ffmpeg -nostats -i /tmp/video.avi /tmp/results/video.mp4
# LOG_PATH=`readlink -f /tmp/mc-control-LocomanipController-latest.bin`
# tar czf /tmp/results/`basename ${LOG_PATH}`.tar.gz -C `dirname ${LOG_PATH}` `basename ${LOG_PATH}`
# - name: Upload simulation data
# # Only run for one configuration
# if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.mc-rtc-version == 'head'
# uses: actions/upload-artifact@v3
# with:
# name: BWC-ci-results
# path: /tmp/results
# - name: Check simulation results
# # Only run for one configuration
# if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.mc-rtc-version == 'head'
# run: |
# set -e
# set -x
# EXPECTED_BASE_POS="1.34 -0.41 0.8"
# python3 ${GITHUB_WORKSPACE}/catkin_ws/src/isri-aist/LocomanipController/.github/workflows/scripts/checkSimulationResults.py `readlink -f /tmp/mc-control-LocomanipController-latest.bin` --expected-base-pos ${EXPECTED_BASE_POS}
- name: Upload documentation
# Only run for one configuration and on master branch
if: matrix.os == 'ubuntu-20.04' && matrix.build-type == 'RelWithDebInfo' && matrix.mc-rtc-version == 'head' && github.repository_owner == 'isri-aist' && github.ref == 'refs/heads/master'
run: |
set -e
set -x
cd ${GITHUB_WORKSPACE}/catkin_ws/src/isri-aist/LocomanipController
git config --global user.name "Masaki Murooka"
git config --global user.email "[email protected]"
git remote set-url origin "https://mmurooka:${{ secrets.CI_TOKEN }}@github.com/isri-aist/LocomanipController"
git fetch --depth=1 origin gh-pages:gh-pages
git clean -dfx
git checkout --quiet gh-pages
rm -rf doxygen/
cp -r ${GITHUB_WORKSPACE}/catkin_ws/build/locomanip_controller/doc/html/ doxygen
git add doxygen
git_status=`git status -s`
if test -n "$git_status"; then
git commit --quiet -m "Update Doxygen HTML files from commit ${{ github.sha }}"
git push origin gh-pages
else
echo "Github pages documentation is already up-to-date."
fi