-
Notifications
You must be signed in to change notification settings - Fork 48
129 lines (115 loc) · 4.42 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
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:${{ matrix.gazebo_version }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release, Debug]
os: [ubuntu-18.04, ubuntu-20.04, macOS-latest]
yarp_version: [yarp-3.4]
# Dummy value to specify additional combination in the include matrix, see
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-new-combinations
combination: [0]
include:
- os: ubuntu-18.04
combination: 0
gazebo_version: gazebo9
- os: ubuntu-18.04
combination: 1
gazebo_version: gazebo10
yarp_version: yarp-3.4
build_type: Release
- os: ubuntu-20.04
gazebo_version: gazebo11
- os: macOS-latest
gazebo_version: gazebo11
steps:
- uses: actions/checkout@v2
# Print environment variables to simplify development and debugging
- name: Environment Variables
shell: bash
run: env
# ============
# DEPENDENCIES
# ============
- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
shell: bash
run: |
# https://github.com/actions/virtual-environments/issues/2322
rm -f /usr/local/bin/2to3
# https://github.com/actions/virtual-environments/issues/2391
brew unlink gcc@8
brew unlink gcc@9
brew update
brew upgrade
brew install --cask xquartz
brew install ace eigen opencv@3 osrf/simulation/${{ matrix.gazebo_version }}
- 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 lib${{ matrix.gazebo_version }}-dev
- name: Source-based Dependencies [Ubuntu/macOS]
if: contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-latest'
shell: bash
run: |
# YCM
git clone https://github.com/robotology/ycm
cd ycm
git checkout ycm-0.11
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/macOS]
if: contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-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 -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
# Workaround for https://github.com/robotology/gazebo-yarp-plugins/issues/536
ctest --output-on-failure -C ${{ matrix.build_type }} -E "ControlBoardControlTest" .
- name: Install [Ubuntu/macOS]
if: contains(matrix.os, 'ubuntu') || matrix.os == 'macOS-latest'
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install