-
Notifications
You must be signed in to change notification settings - Fork 0
436 lines (404 loc) · 13 KB
/
threadpool.yml
File metadata and controls
436 lines (404 loc) · 13 KB
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
name: threadpool
on:
push:
pull_request:
release:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu-clang",
os: ubuntu-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-clang-valgrind",
os: ubuntu-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
valgrind: "ON",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-codecoverage",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "ON",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-asan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "ON",
lsan: "OFF",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-lsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "ON",
tsan: "OFF",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-tsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "ON",
ubsan: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "ubuntu-gcc-ubsan",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
generators: "Ninja",
ccache: "ON",
asan: "OFF",
lsan: "OFF",
tsan: "OFF",
ubsan: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "windows-msvc-vs2019",
os: windows-latest,
build_type: "Release",
cc: "cl",
cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 16 2019",
ccache: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "windows-clang-ninja",
os: windows-latest,
build_type: "Release",
cc: "clang",
cxx: "clang",
generators: "Ninja",
ccache: "OFF",
code_coverage: "OFF",
clang_format: "OFF",
}
- {
name: "macos-clang",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
generators: "Ninja",
ccache: "ON",
code_coverage: "OFF",
clang_format: "OFF",
}
steps:
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: ccache
if: startsWith(matrix.config.ccache, 'ON')
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}-${{ matrix.build_type }}
max-size: 500M
- name: CPM Cache
id: cache-cpm
uses: actions/cache@v2
with:
path: .cpmcache
key: ${{ runner.os }}-cpm-${{ hashFiles('**/') }}
restore-keys: |
${{ runner.os }}-cpm-
- name: Add clang path to $PATH env on Windows
shell: bash
if: matrix.config.name == 'windows-clang-ninja'
run: |
echo "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin" >> $GITHUB_PATH
- uses: seanmiddleditch/gha-setup-ninja@master
if: startsWith(matrix.config.os, 'windows')
- name: Install dependencies on windows
if: startsWith(matrix.config.os, 'windows')
run: |
ninja --version
cmake --version
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
run: |
sudo apt-get install ninja-build
ninja --version
cmake --version
gcc --version
clang --version
- name: Install valgrind on ubuntu
if: matrix.config.valgrind == 'ON'
run: |
sudo apt-get install valgrind
valgrind --version
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install p7zip cmake ninja
ninja --version
cmake --version
- name: Configure (CCACHE)
if: startsWith(matrix.config.ccache, 'ON')
shell: bash
run: |
mkdir build
mkdir instdir
export CC=${{ matrix.config.CC }}
export CXX=${{ matrix.config.CXX }}
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_ASAN=${{ matrix.config.asan }} \
-DTHREADPOOL_LSAN=${{ matrix.config.lsan }} \
-DTHREADPOOL_TSAN=${{ matrix.config.tsan }} \
-DTHREADPOOL_UBSAN=${{ matrix.config.ubsan }} \
-DTHREADPOOL_CODE_COVERAGE=${{ matrix.config.code_coverage }} \
-DTHREADPOOL_VALGRIND=${{ matrix.config.valgrind }} \
-DTHREADPOOL_CLANG_FORMAT_CHECK=${{ matrix.config.clang_format }} \
-DTHREADPOOL_CLANG_FORMAT_FIX=${{ matrix.config.clang_format }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G "${{ matrix.config.generators }}"
- name: Configure
if: startsWith(matrix.config.ccache, 'OFF')
shell: bash
run: |
mkdir build
mkdir instdir
export CC=${{ matrix.config.CC }}
export CXX=${{ matrix.config.CXX }}
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_ASAN=${{ matrix.config.asan }} \
-DTHREADPOOL_LSAN=${{ matrix.config.lsan }} \
-DTHREADPOOL_TSAN=${{ matrix.config.tsan }} \
-DTHREADPOOL_UBSAN=${{ matrix.config.ubsan }} \
-DTHREADPOOL_CODE_COVERAGE=${{ matrix.config.code_coverage }} \
-DTHREADPOOL_VALGRIND=${{ matrix.config.valgrind }} \
-DTHREADPOOL_CLANG_FORMAT_CHECK=${{ matrix.config.clang_format }} \
-DTHREADPOOL_CLANG_FORMAT_FIX=${{ matrix.config.clang_format }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-G "${{ matrix.config.generators }}"
- name: Build
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }}
- name: Install Strip
shell: bash
run: cmake --install build --strip --prefix=instdir
- name: Tests
shell: bash
working-directory: build
run: ctest --C ${{ matrix.config.build_type }} --output-on-failure --no-tests=error
if: always()
- name: Benchmarks
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }} --target threadpool_benchmarks_execute
if: always()
- name: Pack
shell: bash
working-directory: instdir
run: |
ls -laR
7z a ../${{ matrix.config.name }}.7z .
- name: Codecov
if: matrix.config.code_coverage == 'ON'
shell: bash
working-directory: build
run: |
mkdir lcov
wget -c https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15.tar.gz -O - | tar -xz -C lcov/
cd lcov/lcov-1.15
sudo make install
cd ../..
./lcov/lcov-1.15/bin/lcov --capture --directory . --output-file coverage.info
./lcov/lcov-1.15/bin/lcov --remove coverage.info '*/build/_deps/*' '*/tests/*' '*/examples/*' '*/benchmarks/*' '*/.ccache/*' '*/.cpmcache/*' '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
./lcov/lcov-1.15/bin/lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${{ secrets.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports"
- name: Upload Build Developer Logs
uses: actions/upload-artifact@v2
with:
name: 'z-${{ matrix.config.name }}-build_dev_logs'
path: |
./build/**/*.txt
./build/**/*.gcda
./build/**/*.gcno
./build/**/*codecov*
./build/**/*.xml
./build/**/*.cmake
./build/**/*.log
./build/**/*.json
./build/**/*.gcov
./build/**/*.info
./build/**/.*
!./build/_deps
retention-days: 1
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./${{ matrix.config.name }}.7z
name: ${{ matrix.config.name }}.7z
- name: Upload release asset
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ matrix.config.name }}.7z
asset_name: ${{ matrix.config.name }}.7z.zip
asset_content_type: application/zip
clang-format:
name: clang-format
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Formatting
uses: DoozyX/clang-format-lint-action@v0.12
with:
exclude: 'build instdir'
clangFormatVersion: 9
inplace: false
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Install dependencies on ubuntu
run: |
sudo apt-get install ninja-build
sudo apt-get install clang-tidy
ninja --version
cmake --version
gcc --version
clang --version
clang-tidy --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir instdir
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_CLANG_TIDY_CHECK=ON \
-G "Ninja"
- name: Build
shell: bash
run: cmake --build build --config Release --target threadpool_clang_tidy_check
cppcheck:
name: cppcheck
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- name: Install dependencies on ubuntu
run: |
sudo apt-get install ninja-build
sudo apt-get install cppcheck
ninja --version
cmake --version
gcc --version
clang --version
cppcheck --version
- name: Configure
shell: bash
run: |
mkdir build
mkdir instdir
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCPM_SOURCE_CACHE=.cpmcache/ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DTHREADPOOL_CI=ON \
-DTHREADPOOL_CPPCHECK=ON \
-G "Ninja"
- name: Build
shell: bash
run: cmake --build build --config Release --target threadpool_cppcheck