-
Notifications
You must be signed in to change notification settings - Fork 882
239 lines (213 loc) · 7.24 KB
/
gha.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
239
name: CI
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- cpp_master
tags:
- '*'
jobs:
macos:
name: ${{ format('macOS (pattern {0})', matrix.pattern) }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
pattern: [0, 1, 2, 3, 4]
steps:
- uses: actions/checkout@v2
- name: Cache boost
id: cache-boost
uses: actions/cache@v2
with:
path: ~/boost-prefix/
key: ${{ runner.os }}-boost-1-76-0-2022-08-09
- name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ./.github/depends/boost.sh -b 64 -t clang -p $HOME/boost-prefix
- name: Cache zlib
id: cache-zlib
uses: actions/cache@v2
with:
path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
- name: Build zlib
if: steps.cache-zlib.outputs.cache-hit != 'true'
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
- name: Build and test
shell: bash
run: |
# default configuration - overwrite its params later depending on matrix.pattern
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
export ARCH=64
export API_VERSION=3
export CHAR_SIGN="signed"
export X3_PARSE="OFF"
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
case ${{ matrix.pattern }} in
0)
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF"
;;
1)
export API_VERSION=1
;;
2)
export API_VERSION=2
;;
3)
export X3_PARSE="ON"
;;
4)
export CHAR_SIGN="unsigned"
;;
esac
# build and test
export CXX="clang++"
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
linux:
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install g++-10 cmake valgrind -y
sudo apt-get install g++-10-multilib -y # for 32-bit compile
./ci/set_gcc_10.sh
- name: Cache boost
id: cache-boost
uses: actions/cache@v2
with:
path: ~/boost-prefix/
key: ${{ runner.os }}-boost-1-76-0-2021-08-09
- name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ./.github/depends/boost.sh -b both -t gcc -p $HOME/boost-prefix
- name: Cache zlib
id: cache-zlib
uses: actions/cache@v2
with:
path: ~/zlib-prefix/
key: ${{ runner.os }}-zlib-1-2-13-2022-11-02
- name: Build zlib
if: steps.cache-zlib.outputs.cache-hit != 'true'
run: ./.github/depends/zlib.sh -b both -p $HOME/zlib-prefix
- name: Build and test
shell: bash
run: |
# default configuration - overwrite its params later depending on matrix.pattern
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
export ARCH=64
export API_VERSION=3
export CHAR_SIGN="signed"
export X3_PARSE="OFF"
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
export ACTION="ci/build_cmake.sh"
case ${{ matrix.pattern }} in
0)
export CXX="clang++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF"
;;
1)
export CXX="g++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
;;
2)
export CXX="clang++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
;;
3)
export CXX="g++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON"
export MSGPACK_USE_STD_VARIANT_ADAPTOR="MSGPACK_USE_STD_VARIANT_ADAPTOR=ON"
;;
4)
export CXX="clang++-10"
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
export NO_BOOST="-DMSGPACK_NO_BOOST"
;;
5)
export CXX="g++-10"
export ARCH=32
;;
6)
export CXX="clang++-10"
export API_VERSION=2
;;
7)
export CXX="g++-10"
export API_VERSION=1
;;
8)
export CXX="clang++-10"
export CHAR_SIGN="unsigned"
;;
9)
export CXX="g++-10"
export X3_PARSE="ON"
;;
10)
export CXX="clang++-10"
export ACTION="ci/build_regression.sh"
;;
11)
export CXX="g++-10"
export ARCH=32
export CHAR_SIGN="unsigned"
export X3_PARSE="ON"
;;
esac
# build and test
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE} ${NO_BOOST}" ci/build_cmake.sh || exit 1
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
windows:
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
# MSVC2019 only supports /std:c++14, /std:c++17 and /std:c++latest
cxx: [14, 17, 20]
pp_flag: ["/Zc:preprocessor-", "/Zc:preprocessor"]
steps:
- uses: actions/checkout@v2
- name: Cache vcpkg dependencies
id: cache-vcpkg
uses: actions/cache@v2
with:
path: C:/vcpkg/installed/x64-windows
key: ${{ runner.os }}-vcpkg-2021-08-09
- name: Install vcpkg dependencies
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
shell: powershell
run: |
vcpkg update
vcpkg install zlib:x64-windows
vcpkg install boost-assert:x64-windows boost-numeric-conversion:x64-windows boost-variant:x64-windows boost-utility:x64-windows boost-fusion:x64-windows boost-optional:x64-windows boost-predef:x64-windows boost-preprocessor:x64-windows boost-timer:x64-windows boost-test:x64-windows
- name: Build and test
shell: powershell
run: |
$CPPVER="MSGPACK_CXX${{ matrix.cxx }}=ON"
md build
cmake `
-A x64 `
-G "Visual Studio 16 2019" `
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
-D MSGPACK_BUILD_TESTS=ON `
-D $CPPVER `
-D CMAKE_CXX_FLAGS="${{ matrix.pp_flag }} /D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" `
-B build `
-S .
if ($LastExitCode -ne 0) { exit $LastExitCode }
cmake --build build --config Release
if ($LastExitCode -ne 0) { exit $LastExitCode }
ctest -VV --test-dir build -C Release
if ($LastExitCode -ne 0) { exit $LastExitCode }