-
Notifications
You must be signed in to change notification settings - Fork 16
147 lines (143 loc) · 5.16 KB
/
ci-catkin.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
name: CI of CentroidalControlCollection (catkin)
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@v2
- name: Install clang-format-10
run: |
sudo apt-get -qq update
sudo apt-get -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]
build-type: [Debug, RelWithDebInfo]
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 # if [ "${{ matrix.os }}" == "ubuntu-18.04" ]
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 -qq
sudo apt-get install -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-get install -qq libmc-rtc-dev 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@v2
with:
submodules: recursive
path: catkin_ws/src/CentroidalControlCollection
- name: Checkout QpSolverCollection
uses: actions/checkout@v2
with:
repository: isri-aist/QpSolverCollection
submodules: recursive
path: catkin_ws/src/QpSolverCollection
- name: Checkout ForceControlCollection
uses: actions/checkout@v2
with:
repository: isri-aist/ForceControlCollection
submodules: recursive
path: catkin_ws/src/ForceControlCollection
- name: Checkout NMPC
uses: actions/checkout@v2
with:
repository: isri-aist/NMPC
submodules: recursive
path: catkin_ws/src/NMPC
- 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 --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 -- centroidal_control_collection --no-deps
catkin_test_results --verbose --all build
- name: Upload documentation
# Only run for one configuration and on origin 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/CentroidalControlCollection
git config --global user.name "Masaki Murooka"
git config --global user.email "m-murooka@aist.go.jp"
git remote set-url origin "https://mmurooka:${{ secrets.CI_TOKEN }}@github.com/isri-aist/CentroidalControlCollection"
git fetch --depth=1 origin gh-pages:gh-pages
git checkout --quiet gh-pages
rm -rf doxygen/ cmake/
cp -r ${GITHUB_WORKSPACE}/catkin_ws/build/centroidal_control_collection/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