-
Notifications
You must be signed in to change notification settings - Fork 49
366 lines (322 loc) · 9.9 KB
/
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
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
name: Linux
on:
push:
branches:
- master
- dev
paths-ignore:
- '**.md'
- '**/docs/**'
pull_request:
branches:
- master
- dev
paths-ignore:
- '**.md'
- '**/docs/**'
workflow_dispatch:
env:
APT_INSTALL: |
sudo apt-get install
-yq --no-install-suggests --no-install-recommends
--allow-unauthenticated --allow-downgrades --allow-change-held-packages
jobs:
ubuntu:
runs-on: ubuntu-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 22.04, 20.04 ]
std: [ 17, 20 ]
cxx:
- g++-13
- g++-12
- g++-11
- g++-10
- g++-9
- g++-8
- g++-7
- clang++-17
- clang++-16
- clang++-15
- clang++-14
- clang++-13
- clang++-12
- clang++-11
- clang++-10
- clang++-9
- clang++-8
- clang++-7
- clang++-6.0
exclude:
# gcc 8, gcc 7, and clang 6-8 have lacking C++20 support
- cxx: g++-8
std: 20
- cxx: g++-7
std: 20
- cxx: clang++-8
std: 20
- cxx: clang++-7
std: 20
- cxx: clang++-6.0
std: 20
# gcc 8, clang 12, and before aren't available on 22.04
- cxx: g++-8
os: 22.04
- cxx: g++-7
os: 22.04
- cxx: clang++-12
os: 22.04
- cxx: clang++-11
os: 22.04
- cxx: clang++-10
os: 22.04
- cxx: clang++-9
os: 22.04
- cxx: clang++-8
os: 22.04
- cxx: clang++-7
os: 22.04
- cxx: clang++-6.0
os: 22.04
# gcc 12 isn't available on 20.04 (11 and 13 are in ubuntu-toolchain-r)
- cxx: g++-12
os: 20.04
# FIXME?: simdutf has problems with clang 6 and 7 (_ktestc_mask64_u8 undefined)
- cxx: clang++-7
- cxx: clang++-6.0
# FIXME: Locally unreproducible ICE
- cxx: clang++-9
# FIXME: some weird linker issue: undefined reference to range_default_scanner default constructor
- cxx: g++-11
std: 20
os: 20.04
# FIXME?: weird incompatibility with libstdc++ 13 inside <chrono>
# see https://github.com/actions/runner-images/issues/8659
- cxx: clang++-14
std: 20
os: 22.04
- cxx: clang++-13
std: 20
os: 22.04
steps:
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
- name: Create Build Environment
run: |
mkdir ${{ runner.workspace }}/deps
mkdir ${{ runner.workspace }}/build
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
- name: Install dependencies
working-directory: ${{ runner.workspace }}/deps
env:
CXX: ${{ matrix.cxx }}
OS: ${{ matrix.os }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get --allow-unauthenticated -yq update
if [[ "${CXX}" == "g++-13" ]]; then
${APT_INSTALL} g++-13
fi
if [[ "${CXX}" == "g++-12" ]]; then
${APT_INSTALL} g++-12
fi
if [[ "${CXX}" == "g++-11" ]]; then
${APT_INSTALL} g++-11
fi
if [[ "${CXX}" == "g++-10" ]]; then
${APT_INSTALL} g++-10
fi
if [[ "${CXX}" == "g++-9" ]]; then
${APT_INSTALL} g++-9
fi
if [[ "${CXX}" == "g++-8" ]]; then
${APT_INSTALL} g++-8
fi
if [[ "${CXX}" == "g++-7" ]]; then
${APT_INSTALL} g++-7
fi
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
if [[ "${CXX}" == "clang++-18" ]]; then
sudo ./llvm.sh 18
fi
if [[ "${CXX}" == "clang++-17" ]]; then
sudo ./llvm.sh 17
fi
if [[ "${CXX}" == "clang++-16" ]]; then
sudo ./llvm.sh 16
fi
if [[ "${CXX}" == "clang++-15" ]]; then
sudo ./llvm.sh 15
fi
if [[ "${CXX}" == "clang++-14" ]]; then
sudo ./llvm.sh 14
fi
if [[ "${CXX}" == "clang++-13" ]]; then
sudo ./llvm.sh 13
fi
if [[ "${CXX}" == "clang++-12" ]]; then
sudo ./llvm.sh 12
fi
if [[ "${CXX}" == "clang++-11" ]]; then
sudo ./llvm.sh 11
fi
if [[ "${CXX}" == "clang++-10" ]]; then
sudo ./llvm.sh 10
fi
if [[ "${CXX}" == "clang++-9" ]]; then
sudo ./llvm.sh 9
fi
if [[ "${CXX}" == "clang++-8" ]]; then
${APT_INSTALL} clang-8
fi
if [[ "${CXX}" == "clang++-7" ]]; then
${APT_INSTALL} clang-7
fi
if [[ "${CXX}" == "clang++-6.0" ]]; then
${APT_INSTALL} clang-6.0
fi
- name: Checkout
uses: actions/checkout@v4
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
env:
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -DSCN_CI=ON -DSCN_TESTS_LOCALIZED=ON \
-DCMAKE_CXX_STANDARD=${{ matrix.std }} \
$GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: cmake --build . -- -k 0
- name: Test
working-directory: ${{ runner.workspace }}/build
run: ctest --output-on-failure
libcxx:
runs-on: ubuntu-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 22.04, 20.04 ]
std: [ 17, 20 ]
exclude:
# seems to be buggy
- os: 20.04
steps:
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Create Build Environment
run: |
mkdir ${{ runner.workspace }}/build
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
env:
CC: clang
CXX: clang++
run: |
cmake -G Ninja -DSCN_CI=ON -DSCN_TESTS_LOCALIZED=ON \
-DCMAKE_CXX_STANDARD=${{ matrix.std }} \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \
$GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: cmake --build . -- -k 0
- name: Test
working-directory: ${{ runner.workspace }}/build
run: ctest --output-on-failure
alpine:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start docker
run: |
docker run -w /src -dit --name alpine -v $PWD:/src alpine:3.18
echo 'docker exec alpine "$@";' > alpine-run.sh
chmod +x alpine-run.sh
- name: Install dependencies
run: |
./alpine-run.sh apk update
./alpine-run.sh apk add build-base cmake g++ linux-headers git bash ninja
- name: Run CMake
run: |
./alpine-run.sh cmake -G Ninja -S /src -B build -DSCN_CI=ON
- name: Build
run: |
./alpine-run.sh cmake --build build -- -k 0
- name: Test
run: |
./alpine-run.sh bash -c "cd build && ctest --output-on-failure"
asan-and-ubsan:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
std: [ 17, 20 ]
cxx: [ clang++-17 ]
steps:
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
- name: Create Build Environment
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen fi_FI.UTF-8
sudo update-locale
sudo locale -a
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
mkdir ${{ runner.workspace }}/build
- name: Checkout
uses: actions/checkout@v4
- name: Run CMake
working-directory: ${{ runner.workspace }}/build
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_CXX_STANDARD=${{ matrix.std }} \
-DSCN_CI=ON -DSCN_TESTS_LOCALIZED=ON \
-DSCN_USE_ASAN=ON -DSCN_USE_UBSAN=ON \
$GITHUB_WORKSPACE
- name: Build
working-directory: ${{ runner.workspace }}/build
run: |
cmake --build . -- -k 0
- name: Test
working-directory: ${{ runner.workspace }}/build
run: |
ctest --output-on-failure
install-and-consume:
runs-on: ubuntu-22.04
steps:
- name: Setup CMake and Ninja
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v4
- name: Build scnlib
run: |
mkdir ${{ runner.workspace }}/lib-build
cd ${{ runner.workspace }}/lib-build
cmake -G Ninja -DSCN_INSTALL=ON -DSCN_ENABLE_EXTRAS=OFF $GITHUB_WORKSPACE
cmake --build . --target scn
cmake --build . --target install
- name: Build consumer
run: |
mkdir ${{ runner.workspace }}/consumer-build
cd ${{ runner.workspace }}/consumer-build
cmake $GITHUB_WORKSPACE/tests/consumer-test
cmake --build .
- name: Test consumer
working-directory: ${{ runner.workspace }}/consumer-build
run: |
output="$(echo '42' | ./scn-consumer)"
test "$output" -eq 42