-
Notifications
You must be signed in to change notification settings - Fork 48
99 lines (86 loc) · 3.05 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
name: C++ CI Workflow
on:
push:
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 }}@yarp:${{ matrix.yarp_version }}@gazebo:11]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release, Debug]
os: [ubuntu-20.04]
yarp_version: [master]
steps:
- uses: actions/checkout@v2
# Print environment variables to simplify development and debugging
- name: Environment Variables
shell: bash
run: env
# ============
# DEPENDENCIES
# ============
- name: Dependencies [Ubuntu]
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install git build-essential cmake libace-dev libeigen3-dev libopencv-dev
sudo apt-get install libgazebo11-dev
- name: Source-based Dependencies [Ubuntu]
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
# YCM
git clone https://github.com/robotology/ycm
cd ycm
git checkout master
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
# YARP
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp
cd yarp
git checkout ${{ matrix.yarp_version }}
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
# ===================
# CMAKE-BASED PROJECT
# ===================
- name: Configure [Ubuntu]
if: contains(matrix.os, 'ubuntu')
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 -DBUILD_TESTING:BOOL=ON ..
- name: Build
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Test
# Workaround for https://github.com/robotology/gazebo-yarp-plugins/issues/530
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
cd build
ctest --repeat until-pass:5 --output-on-failure -C ${{ matrix.build_type }} .
- name: Install [Ubuntu]
if: contains(matrix.os, 'ubuntu')
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install