-
Notifications
You must be signed in to change notification settings - Fork 6
193 lines (167 loc) · 7.65 KB
/
build-test-linux.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
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
name: Linux CI
on: [push, pull_request, workflow_dispatch]
jobs:
# check for duplicate jobs
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-20.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: "same_content_newer"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/README.md", "**/docs/**"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: ${{ matrix.name }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-20.04-gcc-7,
ubuntu-20.04-gcc-9,
ubuntu-20.04-clang-9,
]
build_type: [Debug, Release]
include:
- name: ubuntu-20.04-gcc-7
os: ubuntu-20.04
compiler: gcc
version: "7"
boost-version: "1.74.0"
eigen-version: "3.3.9"
gtsam-version: "4.2"
highfive-version: "v2.8.0"
- name: ubuntu-20.04-gcc-9
os: ubuntu-20.04
compiler: gcc
version: "9"
boost-version: "1.74.0"
eigen-version: "3.3.9"
gtsam-version: "4.2"
highfive-version: "v2.8.0"
- name: ubuntu-20.04-clang-9
os: ubuntu-20.04
compiler: clang
version: "9"
boost-version: "1.74.0"
eigen-version: "3.3.9"
gtsam-version: "4.2"
highfive-version: "v2.8.0"
steps:
- name: print skip check results
run: echo "should_skip=${{ needs.pre_job.outputs.should_skip }}, reason is ${{ needs.pre_job.outputs.reason }}"
- name: Checkout
uses: actions/checkout@v3
- name: Print job details
run: |
echo "Job ${{ env.GITHUB_JOB }}"
echo "compiler: '${{matrix.compiler}}'"
echo "matrix name: '${{matrix.name}}"
echo "build type: '${{ matrix.build_type }}'"
- name: Install Eigen ${{ matrix.eigen-version }}
run: |
cd ${{runner.workspace}} # cd to runner home
git clone --depth 1 --branch ${{ matrix.eigen-version }} https://gitlab.com/libeigen/eigen eigen3
cd eigen3 && mkdir build && cd build # move into build dir for eigen3
cmake ..
sudo make -j$(nproc) install
- name: Install Python 3.9
run: |
if ["${{matrix.os}}"="ubuntu-18.04"]; then
sudo apt-get -y install libpython-dev python-numpy
else # Ubuntu 20.04
sudo apt-get -y install libpython3-dev python-numpy
fi
- name: Install build tools
run: |
# LLVM (clang) 9 is not in Bionic's repositories so we add the official LLVM repository.
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ] && [ "${{matrix.os}}"="ubuntu-18.04" ]; then
# (ipv4|ha).pool.sks-keyservers.net is the SKS GPG global keyserver pool
# ipv4 avoids potential timeouts because of crappy IPv6 infrastructure
# 15CF4D18AF4F7421 is the GPG key for the LLVM apt repository
# This key is not in the keystore by default for Ubuntu so we need to add it.
LLVM_KEY=15CF4D18AF4F7421
gpg --keyserver keyserver.ubuntu.com --recv-key $LLVM_KEY || gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key $LLVM_KEY
gpg -a --export $LLVM_KEY | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
fi
sudo apt-get -y update
sudo apt-get -y install cmake build-essential pkg-config libicu-dev
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
fi
- name: Install Boost ${{ matrix.boost-version }}
run: |
BOOST_FOLDER=$(echo "boost_${{ matrix.boost-version }}" | tr '.' '_')
wget https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/${BOOST_FOLDER}.tar.gz
tar -zxf ${BOOST_FOLDER}.tar.gz
cd ${BOOST_FOLDER}/
./bootstrap.sh --with-libraries=serialization,filesystem,thread,system,atomic,date_time,timer,chrono,program_options,regex
sudo ./b2 -j$(nproc) install
- name: Install GTSAM ${{ matrix.gtsam-version }}
run: |
cd ${{runner.workspace}} # cd to runner home
git clone --depth 1 --branch ${{ matrix.gtsam-version }} https://github.com/borglab/gtsam.git gtsam
cd gtsam && mkdir build && cd build # move into build dir for gtsam
cmake -DCMAKE_BUILD_TYPE=Release -DGTSAM_WITH_EIGEN_MKL=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TIMING_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=OFF -DGTSAM_UNSTABLE_BUILD_PYTHON=OFF ..
sudo make -j$(nproc) install
- name: Install hdf5
run: sudo apt-get -y install libhdf5-serial-dev
- name: Install HighFive ${{ matrix.highfive-version }}
run: |
cd ${{runner.workspace}} # cd to runner home
git clone --depth 1 --branch ${{ matrix.highfive-version }} https://github.com/BlueBrain/HighFive HighFive
cd HighFive && mkdir build && cd build # move into build dir for HighFive
cmake -DHIGHFIVE_USE_BOOST=OFF ..
sudo make -j$(nproc) install
- name: Install LCov
if: matrix.name == 'ubuntu-20.04-gcc-9' && matrix.build_type == 'Debug'
run: sudo apt-get update -q && sudo apt-get install lcov -q -y
- name: Build bioslam
run: |
cd ${{github.workspace}} # cd to repo root
mkdir build && cd build # move into bioslam build dir
cmake -DBIOSLAM_BUILD_MATLAB_WRAPPER=OFF ..
sudo make -j$(nproc) install
- name: Test bioslam
run: |
cd ${{github.workspace}}/build
make -j$(nproc) test
- name: Run LCov
if: matrix.name == 'ubuntu-20.04-gcc-9' && matrix.build_type == 'Debug'
run: |
cd ${{github.workspace}}/build # cd to build folder
lcov -c -d . --include '*bioslam*' -o main_coverage.info
- name: Submit to codecov.io
if: matrix.name == 'ubuntu-20.04-gcc-9' && matrix.build_type == 'Debug'
uses: codecov/codecov-action@v3
with:
files: ${{github.workspace}}/build/main_coverage.info
token: ${{ secrets.CODECOV_TOKEN }} # supposedly not required for public repos, but codecov fails otherwise
name: bioslam-codecov # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Archive code coverage results
if: matrix.name == 'ubuntu-20.04-gcc-9' && matrix.build_type == 'Debug'
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: ${{github.workspace}}/build/main_coverage.info
retention-days: 30