-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (122 loc) · 5.04 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
130
131
132
133
134
135
136
name: Continuous Integration
on:
push:
branches:
- 'master'
- 'feat/**'
- 'fix/**'
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 }}]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_type: [Release, Debug]
os: [ubuntu-latest]
yarp: [true, false]
steps:
- uses: actions/checkout@master
- name: Display environment variables
shell: bash
run: env
# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
# ============
# DEPENDENCIES
# ============
- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libboost-all-dev git build-essential clang valgrind cmake \
libmatio-dev libtinyxml-dev \
libace-dev libeigen3-dev
- name: Source-based Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
# YCM
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/ycm.git --depth 1 --branch master
cd ycm && mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
cmake --build . --config ${{ matrix.build_type }} --target install
if ${{matrix.yarp}}; then
# yarp
cd ${GITHUB_WORKSPACE}
git clone https://github.com/robotology/yarp.git --depth 1 --branch yarp-3.6
cd yarp && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
fi
# matio-cpp
cd ${GITHUB_WORKSPACE}
git clone https://github.com/ami-iit/matio-cpp.git --depth 1 --branch master
cd matio-cpp && mkdir -p build && cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }} --target install
# ===================
# CMAKE-BASED PROJECT
# ===================
- name: Configure [Ubuntu]
if: matrix.os == 'ubuntu-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: Enable Valgrind tests [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DROBOMETRY_VALGRIND_TESTS:BOOL=ON ..
- name: Build
shell: bash
run: |
cd build
# Fix for using YARP idl generators (that link ACE) in Windows
# See https://github.com/robotology/idyntree/issues/569 for more details
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin
cmake --build . --config ${{ matrix.build_type }}
- name: Install
shell: bash
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} --target install
- name: Test
shell: bash
run: |
cd build
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${GITHUB_WORKSPACE}/install/deps/bin:/c/robotology/vcpkg/installed/x64-windows/bin:/c/robotology/vcpkg/installed/x64-windows/debug/bin
ctest --output-on-failure -C ${{ matrix.build_type }} .
- name: Test load of tdd plugin [Ubuntu]
if: matrix.os == 'ubuntu-latest' && matrix.yarp
shell: bash
run: |
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${GITHUB_WORKSPACE}/install/deps/bin:/c/robotology/vcpkg/installed/x64-windows/bin:/c/robotology/vcpkg/installed/x64-windows/debug/bin
export YARP_DATA_DIRS=$YARP_DATA_DIRS:${GITHUB_WORKSPACE}/install/share/yarp
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GITHUB_WORKSPACE}/install/lib
yarp plugin telemetryDeviceDumper
- name: Run examples with valgrind [Ubuntu]
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
cd build/bin
valgrind --tool=memcheck --leak-check=full ./circular_buffer_example
valgrind --tool=memcheck --leak-check=full ./robometry_buffer_example
valgrind --tool=memcheck --leak-check=full ./robometry_buffer_manager_conf_file_example
valgrind --tool=memcheck --leak-check=full ./robometry_buffer_manager_example
valgrind --tool=memcheck --leak-check=full ./robometry_buffer_periodic_save