-
Notifications
You must be signed in to change notification settings - Fork 761
238 lines (204 loc) · 9.67 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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
name: cereal linux ci
on: [push, pull_request]
jobs:
test_cereal_linux:
runs-on: ubuntu-latest
container: ${{ matrix.CONTAINER }}
strategy:
fail-fast: false
matrix:
include:
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.7'
EXTRA_APT_PACKAGES: 'g++-4.7'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.7
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.8'
EXTRA_APT_PACKAGES: 'g++-4.8'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.8
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'g++-4.9'
EXTRA_APT_PACKAGES: 'g++-4.9'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.9
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'g++-5'
EXTRA_APT_PACKAGES: 'g++-5'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++4.5
- COMPILER: 'g++-5'
EXTRA_APT_PACKAGES: 'gcc-multilib g++-5-multilib linux-libc-dev'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++5-multilib
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'g++-6'
EXTRA_APT_PACKAGES: 'g++-6'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++6
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-7'
EXTRA_APT_PACKAGES: 'g++-7'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++7
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-8'
EXTRA_APT_PACKAGES: 'g++-8'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-g++8
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-9'
EXTRA_APT_PACKAGES: 'g++-9'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-g++9
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'g++-10'
EXTRA_APT_PACKAGES: 'g++-10'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-g++10
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.5'
EXTRA_APT_PACKAGES: 'clang-3.5'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.5 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.5
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.6'
EXTRA_APT_PACKAGES: 'clang-3.6'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.6 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.6
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.7'
EXTRA_APT_PACKAGES: 'clang-3.7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.7 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.7
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.8'
EXTRA_APT_PACKAGES: 'clang-3.8'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.8 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.8
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-3.9'
EXTRA_APT_PACKAGES: 'clang-3.9'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/precise/ llvm-toolchain-precise-3.9 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-3.9
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-4.0'
EXTRA_APT_PACKAGES: 'clang-4.0 g++-5'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-4.0
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON'
COMPILER: 'clang++-5.0'
EXTRA_APT_PACKAGES: 'clang-5.0 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-5.0
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-5.0'
EXTRA_APT_PACKAGES: 'clang-5.0 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-5.0-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-7'
EXTRA_APT_PACKAGES: 'clang-7 g++-7'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-7-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17 -DCLANG_USE_LIBCPP=ON -DSKIP_PERFORMANCE_COMPARISON=ON'
COMPILER: 'clang++-8'
EXTRA_APT_PACKAGES: 'clang-8 g++-8 libc++-8-dev libc++abi-8-dev'
LLVM_APT_SOURCE: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
CONTAINER: ubuntu:16.04
NAME: ubuntu-16.04-clang-8-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-9'
EXTRA_APT_PACKAGES: 'clang-9'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-9-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-10'
EXTRA_APT_PACKAGES: 'clang-10'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-10-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-11'
EXTRA_APT_PACKAGES: 'clang-11'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-11-cpp17
- CMAKE_OPTIONS: '-DSKIP_PORTABILITY_TEST=ON -DCMAKE_CXX_STANDARD=17'
COMPILER: 'clang++-12'
EXTRA_APT_PACKAGES: 'clang-12'
CONTAINER: ubuntu:20.04
NAME: ubuntu-20.04-clang-12-cpp17
name: ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: install deps and test
shell: bash
env:
CMAKE_OPTIONS: ${{ matrix.CMAKE_OPTIONS }}
COMPILER: ${{ matrix.COMPILER }}
EXTRA_APT_PACKAGES: ${{ matrix.EXTRA_APT_PACKAGES }}
LLVM_APT_SOURCE: ${{ matrix.LLVM_APT_SOURCE }}
run: |
set -ex
apt-get update -y
DEBIAN_FRONTEND=noninteractive TZ=America/Los_Angeles apt-get install -y software-properties-common wget python3-pip make apt-transport-https
# Add apt repositories for older Ubuntu
. /etc/os-release
if [[ "${VERSION_ID}" == "16.04" ]]; then
add-apt-repository ppa:ubuntu-toolchain-r/test -y
add-apt-repository ppa:mhier/libboost-latest -y
fi
if [[ "${LLVM_APT_SOURCE}" != "" ]]; then
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository "${LLVM_APT_SOURCE}"
fi
apt-get update -y
# Install apt packages
apt-get install libboost-serialization-dev libboost-dev ${EXTRA_APT_PACKAGES} -y
pip3 install cmake
# Set compiler and env variables
export CXX=${COMPILER}
${CXX} --version
DEPS_DIR="${PWD}/deps"
mkdir -p "${DEPS_DIR}"
pushd "${DEPS_DIR}"
JOBS=2
# Install the right version of libc++
LLVM_INSTALL=${DEPS_DIR}/llvm/install
# if in linux and compiler clang and llvm not installed
if [[ "${CXX}" == "clang"* && -n "$(ls -A ${LLVM_INSTALL})" ]]; then
if [[ "${CXX}" == "clang++-3.6" ]]; then LLVM_VERSION="3.6.2";
elif [[ "${CXX}" == "clang++-3.7" ]]; then LLVM_VERSION="3.7.1";
elif [[ "${CXX}" == "clang++-3.8" ]]; then LLVM_VERSION="3.8.1";
elif [[ "${CXX}" == "clang++-3.9" ]]; then LLVM_VERSION="3.9.1";
fi
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
mkdir -p llvm llvm/build llvm/projects/libcxx llvm/projects/libcxxabi
wget -O - ${LLVM_URL} | tar --strip-components=1 -xJ -C llvm
wget -O - ${LIBCXX_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxx
wget -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C llvm/projects/libcxxabi
(cd llvm/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_INSTALL})
(cd llvm/build/projects/libcxx && make install -j2)
(cd llvm/build/projects/libcxxabi && make install -j2)
export CXXFLAGS="-isystem ${LLVM_INSTALL}/include/c++/v1"
export LDFLAGS="-L ${LLVM_INSTALL}/lib -l c++ -l c++abi"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_INSTALL}/lib"
fi
popd
# Build cereal and test
cmake --version
mkdir build && cd build
cmake ${CMAKE_OPTIONS} .. && make -j4 VERBOSE=1
ctest . --output-on-failure