Repository navigation
594 lines (580 loc) · 25.7 KB
/
Copy pathci.yml
File metadata and controls
594 lines (580 loc) · 25.7 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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
name: CI
on:
push:
branches: [ main, stable ]
pull_request:
branches: [ main ]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
std: [11, 17]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Configure
run: cmake -S . -B build -DLOGIT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DLOGIT_WITH_SYSLOG=ON -DLOGIT_WITH_WIN_EVENT_LOG=OFF
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix install
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Configure benchmarks
# if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/stable') }}
run: cmake -S . -B build-bench -DLOGIT_BENCH_ENABLE=ON -DLOGIT_BENCH_WITH_SPDLOG=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DLOGIT_WITH_SYSLOG=ON -DLOGIT_WITH_WIN_EVENT_LOG=OFF
- name: Build benchmarks
# if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/stable') }}
run: cmake --build build-bench --target logit_bench logit_bench_async_contract logit_bench_async_payload_contract_test logit_bench_flush_test logit_bench_pipeline_research logit_public_macro_bench logit_public_macro_formatted_bench logit_hotpath_bench logit_hotpath_bench_legacy logit_exec_mx_bench logit_exec_mx_bench_concurrent logit_producer_profile logit_task_ownership_profile benchmark_validation_test
- name: Run spdlog async flush regression
run: ./build-bench/logit_bench_flush_test
- name: Run public macro benchmark smoke
env:
LOGIT_PUBLIC_BENCH_TOTAL: 2000
LOGIT_PUBLIC_BENCH_PRODUCERS: 4
LOGIT_PUBLIC_BENCH_WARMUP: 200
run: ./build-bench/logit_public_macro_bench
- name: Run formatted public macro benchmark smoke
env:
LOGIT_PUBLIC_BENCH_TOTAL: 2000
LOGIT_PUBLIC_BENCH_PRODUCERS: 4
LOGIT_PUBLIC_BENCH_WARMUP: 200
run: ./build-bench/logit_public_macro_formatted_bench
- name: Run benchmark validation tests
run: ./build-bench/benchmark_validation_test
- name: Run producer profiling smoke
if: matrix.std == 17
env:
LOGIT_PRODUCER_PROFILE_TOTAL: 2000
LOGIT_PRODUCER_PROFILE_WARMUP: 200
LOGIT_PRODUCER_PROFILE_REPEATS: 1
run: ./build-bench/logit_producer_profile
- name: Run task ownership profiling smoke
if: matrix.std == 17
env:
LOGIT_TASK_OWNERSHIP_TOTAL: 200
LOGIT_TASK_OWNERSHIP_WARMUP: 20
LOGIT_TASK_OWNERSHIP_REPEATS: 1
LOGIT_TASK_OWNERSHIP_ROUNDTRIP_TOTAL: 50
run: ./build-bench/logit_task_ownership_profile
- name: Run async payload contract regression
run: ./build-bench/logit_bench_async_payload_contract_test
- name: Run logger hot-path A/B smoke
env:
LOGIT_HOTPATH_BENCH_TOTAL: 20000
run: |
./build-bench/logit_hotpath_bench
./build-bench/logit_hotpath_bench_legacy
- name: Run exec_mx capability A/B smoke
env:
LOGIT_EXEC_MX_BENCH_TOTAL: 2000
run: |
./build-bench/logit_exec_mx_bench
./build-bench/logit_exec_mx_bench_concurrent
- name: Run latency benchmarks
# if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/stable') }}
timeout-minutes: 20
env:
LOGIT_BENCH_TIMEOUT_SEC: 900
LOGIT_BENCH_TOTAL: 20000
LOGIT_BENCH_WARMUP: 2000
run: ./build-bench/logit_bench
- name: Run contract-matched async benchmark smoke
env:
LOGIT_BENCH_FILTER_ASYNC: "1"
LOGIT_BENCH_FILTER_SINK: "null"
LOGIT_BENCH_FILTER_PRODUCERS: "4"
LOGIT_BENCH_FILTER_BYTES: "200"
LOGIT_BENCH_TOTAL: 2000
LOGIT_BENCH_WARMUP: 200
LOGIT_BENCH_TIMEOUT_SEC: 120
LOGIT_BENCH_OUTPUT: bench/results/latency-async-contract.csv
run: ./build-bench/logit_bench_async_contract
- name: Run pipeline research matrix smoke
if: matrix.std == 17
env:
LOGIT_BENCH_TOTAL: 1000
LOGIT_BENCH_WARMUP: 100
LOGIT_BENCH_REPEATS: 1
LOGIT_BENCH_PRODUCERS: 1
LOGIT_BENCH_QUEUE_CAPACITIES: 1024
LOGIT_BENCH_RESEARCH_CSV: build-bench/pipeline-research-matrix.csv
LOGIT_BENCH_RESEARCH_JSONL: build-bench/pipeline-research-matrix.jsonl
LOGIT_BENCH_RESEARCH_AGGREGATE: build-bench/pipeline-research-matrix-aggregate.csv
run: |
./build-bench/logit_bench_pipeline_research
test -s build-bench/pipeline-research-matrix.csv
test -s build-bench/pipeline-research-matrix.jsonl
python3 - <<'PY'
import csv
with open("build-bench/pipeline-research-matrix.csv", newline="") as stream:
rows = list(csv.DictReader(stream))
assert rows, "matrix research receipt is empty"
assert all(int(row["issued"]) == int(row["sink_completed"]) == int(row["total"]) for row in rows)
PY
- name: Run pipeline research rate smoke
if: matrix.std == 17
env:
LOGIT_BENCH_RESEARCH_MODE: rate
LOGIT_BENCH_TOTAL: 1000
LOGIT_BENCH_WARMUP: 100
LOGIT_BENCH_REPEATS: 1
LOGIT_BENCH_PRODUCERS: 1
LOGIT_BENCH_RATES: 100000
LOGIT_BENCH_RESEARCH_CSV: build-bench/pipeline-research-rate.csv
LOGIT_BENCH_RESEARCH_JSONL: build-bench/pipeline-research-rate.jsonl
LOGIT_BENCH_RESEARCH_AGGREGATE: build-bench/pipeline-research-rate-aggregate.csv
run: |
./build-bench/logit_bench_pipeline_research
test -s build-bench/pipeline-research-rate.csv
test -s build-bench/pipeline-research-rate.jsonl
python3 - <<'PY'
import csv
with open("build-bench/pipeline-research-rate.csv", newline="") as stream:
rows = list(csv.DictReader(stream))
assert rows, "rate research receipt is empty"
assert all(int(row["issued"]) == int(row["sink_completed"]) == int(row["total"]) for row in rows)
PY
- name: Configure consumer project
run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install -DCMAKE_CXX_STANDARD=${{ matrix.std }}
- name: Build consumer project
run: cmake --build build-consumer
- name: Configure and install fmt dependency
if: matrix.std == 17
run: cmake -S external/fmt -B build-fmt -DFMT_TEST=OFF -DFMT_DOC=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install-fmt
- name: Build and install fmt dependency
if: matrix.std == 17
run: |
cmake --build build-fmt
cmake --install build-fmt
- name: Configure fmt-enabled package
if: matrix.std == 17
run: cmake -S . -B build-fmt-package -DLOGIT_CPP_BUILD_TESTS=OFF -DLOGIT_WITH_FMT=ON -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install-fmt -DLOGIT_WITH_SYSLOG=OFF -DLOGIT_WITH_WIN_EVENT_LOG=OFF
- name: Install fmt-enabled package
if: matrix.std == 17
run: |
cmake --build build-fmt-package
cmake --install build-fmt-package --prefix install-fmt-package
- name: Configure fmt-enabled consumer project
if: matrix.std == 17
run: cmake -S tests/install_consumer -B build-fmt-consumer -DLOGIT_CONSUMER_REQUIRE_FMT=ON -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install-fmt-package;${{ github.workspace }}/install-fmt"
- name: Build fmt-enabled consumer project
if: matrix.std == 17
run: cmake --build build-fmt-consumer
- name: Configure build-tree dependency reuse
if: matrix.std == 17
run: >-
cmake -S tests/dependency_reuse/build_tree -B build-timeshield-reuse
-DLOGIT_SOURCE_DIR=${{ github.workspace }}
-DCMAKE_DISABLE_FIND_PACKAGE_TimeShield=TRUE
- name: Configure installed dependency reuse
if: matrix.std == 17
run: >-
cmake -S tests/dependency_reuse/installed -B build-installed-reuse
-DLOGIT_SOURCE_DIR=${{ github.workspace }}
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install-fmt-package
-DCMAKE_DISABLE_FIND_PACKAGE_TimeShield=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_fmt=TRUE
- name: Build installed dependency reuse
if: matrix.std == 17
run: cmake --build build-installed-reuse
- name: Configure Prometheus server package
if: matrix.std == 17
run: cmake -S . -B build-prometheus-package -DLOGIT_CPP_BUILD_TESTS=OFF -DLOGIT_WITH_PROMETHEUS_SERVER=ON -DLOGIT_WITH_SYSLOG=OFF -DLOGIT_WITH_WIN_EVENT_LOG=OFF
- name: Build Prometheus server package
if: matrix.std == 17
run: cmake --build build-prometheus-package
- name: Verify Prometheus server install guard
if: matrix.std == 17
run: cmake -DBUILD_DIR=${{ github.workspace }}/build-prometheus-package -DINSTALL_PREFIX=${{ github.workspace }}/install-prometheus -P tests/check_prometheus_server_install_guard.cmake
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.std }}
path: |
build/CMakeFiles/CMakeOutput.log
build/Testing/Temporary/LastTest.log
if-no-files-found: ignore
linux-mdbx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Configure MDBX
run: cmake -S . -B build-mdbx -DLOGIT_CPP_BUILD_TESTS=ON -DLOGIT_CPP_BUILD_EXAMPLES=ON -DLOGIT_WITH_MDBX=ON -DLOGIT_USE_SUBMODULES=ON -DCMAKE_CXX_STANDARD=17
- name: Build MDBX
run: cmake --build build-mdbx
- name: Test MDBX
run: ctest --test-dir build-mdbx --output-on-failure -R mdbx_logger_test
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-mdbx
path: |
build-mdbx/CMakeFiles/CMakeOutput.log
build-mdbx/Testing/Temporary/LastTest.log
if-no-files-found: ignore
linux-otlp:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Install OTLP build dependencies
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev libssl-dev
- name: Configure OTLP
run: >-
cmake -S . -B build-otlp
-DLOGIT_CPP_BUILD_TESTS=ON
-DLOGIT_WITH_OTLP=ON
-DLOGIT_WITH_GZIP=ON
-DLOGIT_WITH_ZSTD=ON
-DLOGIT_USE_SUBMODULES=ON
-DKURLYK_USE_FALLBACK_ASIO=ON
-DKURLYK_USE_FALLBACK_SIMPLE_WS_SERVER=ON
-DKURLYK_AUTH_SUPPORT=OFF
-DKURLYK_OAUTH_SUPPORT=OFF
-DLOGIT_WITH_SYSLOG=OFF
-DLOGIT_WITH_WIN_EVENT_LOG=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_STANDARD=17
- name: Build OTLP tests
run: cmake --build build-otlp --parallel 2
- name: Run OTLP tests
run: ctest --test-dir build-otlp --output-on-failure -R '^otlp_'
- name: Run compressed file reader tests
run: >-
ctest --test-dir build-otlp
--output-on-failure
--timeout 10
-R '^file_logger_(gzip_compression|truncated_gzip|zstd_compression)_test$'
- name: Upload OTLP logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-otlp
path: |
build-otlp/CMakeFiles/CMakeOutput.log
build-otlp/Testing/Temporary/LastTest.log
if-no-files-found: ignore
linux-package-consumers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Install package-consumer tools
run: sudo apt-get update && sudo apt-get install -y pkg-config
- name: Install TimeShield dependency
run: |
cmake -S external/time-shield-cpp -B build-timeshield \
-DTIME_SHIELD_CPP_BUILD_TESTS=OFF \
-DTIME_SHIELD_CPP_BUILD_EXAMPLES=OFF \
-DTIME_SHIELD_ENABLE_NTP_CLIENT=OFF \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-timeshield"
cmake --build build-timeshield
cmake --install build-timeshield
- name: Build and install source package
run: |
cmake -S . -B build-package \
-DLOGIT_CPP_BUILD_TESTS=OFF \
-DLOGIT_WITH_SYSLOG=OFF \
-DLOGIT_WITH_WIN_EVENT_LOG=OFF \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install-logit" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield"
cmake --build build-package
cmake --install build-package
- name: Configure pkg-config consumer
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/install-logit/share/pkgconfig:${{ github.workspace }}/install-timeshield/lib/pkgconfig
run: |
pkg-config --exists log-it-cpp
test "$(pkg-config --modversion log-it-cpp)" = "1.0.2"
pkg-config --print-requires log-it-cpp
pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield >= 2.0.0'
pkg-config --print-requires log-it-cpp | grep -Fx 'time-shield < 2.1.0'
pkg-config --atleast-version=2.0.0 time-shield
cmake -S tests/pkgconfig_consumer -B build-pkgconfig
- name: Build and run pkg-config consumer
run: |
cmake --build build-pkgconfig
./build-pkgconfig/pkgconfig_consumer
- name: Create clean source archive
run: |
archive_root="$RUNNER_TEMP/logit-archive"
mkdir -p "$archive_root/source"
git archive --format=tar.gz --prefix=log-it-cpp/ HEAD > "$RUNNER_TEMP/log-it-cpp.tar.gz"
tar -xzf "$RUNNER_TEMP/log-it-cpp.tar.gz" -C "$archive_root/source"
- name: Build and install clean source archive
run: |
archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp"
cmake -S "$archive_source" -B "$RUNNER_TEMP/logit-archive/build" \
-DLOGIT_CPP_BUILD_TESTS=OFF \
-DLOGIT_WITH_SYSLOG=OFF \
-DLOGIT_WITH_WIN_EVENT_LOG=OFF \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/logit-archive/install" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-timeshield"
cmake --build "$RUNNER_TEMP/logit-archive/build"
cmake --install "$RUNNER_TEMP/logit-archive/build"
- name: Build and run clean archive consumer
run: |
archive_source="$RUNNER_TEMP/logit-archive/source/log-it-cpp"
cmake -S "$archive_source/tests/install_consumer" -B "$RUNNER_TEMP/logit-archive/consumer" \
-DCMAKE_PREFIX_PATH="$RUNNER_TEMP/logit-archive/install;$GITHUB_WORKSPACE/install-timeshield"
cmake --build "$RUNNER_TEMP/logit-archive/consumer"
"$RUNNER_TEMP/logit-archive/consumer/install_consumer"
windows:
runs-on: windows-latest
strategy:
matrix:
std: [11, 17]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Configure
run: cmake -S . -B build -DLOGIT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DLOGIT_WITH_SYSLOG=OFF -DLOGIT_WITH_WIN_EVENT_LOG=ON
- name: Build
run: cmake --build build --config Release
- name: Install
run: cmake --install build --prefix install --config Release
- name: Test
run: ctest --test-dir build -C Release
- name: Configure consumer project
run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install" -DCMAKE_CXX_STANDARD=${{ matrix.std }}
- name: Build consumer project
run: cmake --build build-consumer --config Release
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.std }}
path: |
build/CMakeFiles/CMakeOutput.log
build/Testing/Temporary/LastTest.log
if-no-files-found: ignore
macos:
runs-on: macos-latest
strategy:
matrix:
std: [11, 17]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Configure
run: cmake -S . -B build -DLOGIT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DLOGIT_WITH_SYSLOG=ON -DLOGIT_WITH_WIN_EVENT_LOG=OFF
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix install
- name: Test
run: ctest --test-dir build
- name: Configure consumer project
run: cmake -S tests/install_consumer -B build-consumer -DCMAKE_PREFIX_PATH=${{ github.workspace }}/install -DCMAKE_CXX_STANDARD=${{ matrix.std }}
- name: Build consumer project
run: cmake --build build-consumer
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.std }}
path: |
build/CMakeFiles/CMakeOutput.log
build/Testing/Temporary/LastTest.log
if-no-files-found: ignore
linux-extras:
name: ${{ matrix.suite }}
runs-on: ubuntu-latest
env:
VCPKG_TAG: '2024.09.30'
strategy:
fail-fast: false
matrix:
suite: [asan-ubsan, tsan, odr, bench-asan, vcpkg-install]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- name: Configure (asan-ubsan)
if: matrix.suite == 'asan-ubsan'
run: cmake -S . -B build -DLOGIT_CPP_BUILD_TESTS=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS='-fsanitize=address,undefined' -DCMAKE_LINKER_FLAGS='-fsanitize=address,undefined'
- name: Build (asan-ubsan)
if: matrix.suite == 'asan-ubsan'
run: cmake --build build
- name: Test (asan-ubsan)
if: matrix.suite == 'asan-ubsan'
run: ctest --test-dir build --output-on-failure
- name: Configure (tsan)
if: matrix.suite == 'tsan'
env:
LOGIT_PROFILE: thread
run: cmake -S . -B build -DLOGIT_CPP_BUILD_TESTS=ON -DLOGIT_FORCE_ASYNC_OFF=OFF -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS='-fsanitize=thread' -DCMAKE_LINKER_FLAGS='-fsanitize=thread'
- name: Build (tsan)
if: matrix.suite == 'tsan'
run: cmake --build build
- name: Test (tsan)
if: matrix.suite == 'tsan'
run: ctest --test-dir build --output-on-failure
- name: Install dependencies (odr)
if: matrix.suite == 'odr'
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Build Logit ODR header
if: matrix.suite == 'odr'
working-directory: tests/odr
run: |
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_logger_a.cpp
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_logger_b.cpp
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_logger_main.cpp
g++ get_logger_a.o get_logger_b.o get_logger_main.o -o app_logger
- name: Run ConsoleApp ODR header
if: matrix.suite == 'odr'
working-directory: tests/odr
run: ./app_logger
- name: Build Task Executor ODR header
if: matrix.suite == 'odr'
working-directory: tests/odr
run: |
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_executor_a.cpp
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_executor_b.cpp
g++ -std=c++17 -I ../../include -I ../../external/time-shield-cpp/include -c get_executor_main.cpp
g++ get_executor_a.o get_executor_b.o get_executor_main.o -o app_executor
- name: Run Task Executor ODR header
if: matrix.suite == 'odr'
working-directory: tests/odr
run: ./app_executor
- name: Configure benchmarks (asan)
if: matrix.suite == 'bench-asan'
run: |
cmake -S . -B build-bench-asan \
-DLOGIT_BENCH_ENABLE=ON \
-DLOGIT_BENCH_WITH_SPDLOG=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS='-fsanitize=address,undefined -fno-omit-frame-pointer -g' \
-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=address,undefined'
- name: Build benchmarks (asan)
if: matrix.suite == 'bench-asan'
run: cmake --build build-bench-asan --target logit_bench
- name: Run spdlog async null bench (asan)
if: matrix.suite == 'bench-asan'
timeout-minutes: 10
env:
LOGIT_BENCH_FILTER_LIB: spdlog
LOGIT_BENCH_FILTER_ASYNC: "1"
LOGIT_BENCH_FILTER_SINK: null
LOGIT_BENCH_FILTER_PRODUCERS: "4"
LOGIT_BENCH_FILTER_BYTES: "40"
LOGIT_BENCH_TOTAL: 200
LOGIT_BENCH_WARMUP: 20
LOGIT_BENCH_TIMEOUT_SEC: 120
run: ./build-bench-asan/logit_bench
- name: Restore vcpkg cache
if: matrix.suite == 'vcpkg-install'
id: cache-vcpkg
uses: actions/cache/restore@v3
with:
path: |
vcpkg
vcpkg/downloads
vcpkg/installed
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_TAG }}-${{ github.sha }}-${{ hashFiles('vcpkg-overlay/ports/**', 'external/time-shield-cpp/vcpkg-overlay/ports/**') }}
- name: Install vcpkg
if: matrix.suite == 'vcpkg-install' && steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/microsoft/vcpkg.git --branch $VCPKG_TAG --single-branch
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Prepare current-source vcpkg port
if: matrix.suite == 'vcpkg-install'
env:
SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
set -euo pipefail
mkdir -p .ci/vcpkg-overlay/ports/log-it-cpp
cp vcpkg-overlay/ports/log-it-cpp/vcpkg.json .ci/vcpkg-overlay/ports/log-it-cpp/vcpkg.json
cp vcpkg-overlay/ports/log-it-cpp/portfile.cmake .ci/vcpkg-overlay/ports/log-it-cpp/portfile.cmake
archive_sha512=$(curl --fail --silent --show-error -L \
"https://github.com/LimiNode/log-it-cpp/archive/${SOURCE_SHA}.tar.gz" | sha512sum | awk '{print $1}')
sed -i "s#REF .*#REF ${SOURCE_SHA}#; s#SHA512 .*#SHA512 ${archive_sha512}#" \
.ci/vcpkg-overlay/ports/log-it-cpp/portfile.cmake
sed -i 's/"version-string": "1.0.1"/"version-string": "1.0.2-dev"/' \
.ci/vcpkg-overlay/ports/log-it-cpp/vcpkg.json
- name: Validate current-source port
if: matrix.suite == 'vcpkg-install'
run: |
./vcpkg/vcpkg install log-it-cpp \
--overlay-ports=.ci/vcpkg-overlay/ports \
--overlay-ports=external/time-shield-cpp/vcpkg-overlay/ports
- name: Configure consumer project
if: matrix.suite == 'vcpkg-install'
run: cmake -B build -S tests/install_consumer -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build consumer project
if: matrix.suite == 'vcpkg-install'
run: cmake --build build
- name: Save vcpkg cache
if: matrix.suite == 'vcpkg-install' && success() && steps.cache-vcpkg.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
vcpkg
vcpkg/downloads
vcpkg/installed
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_TAG }}-${{ github.sha }}-${{ hashFiles('vcpkg-overlay/ports/**', 'external/time-shield-cpp/vcpkg-overlay/ports/**') }}
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.suite }}
path: |
build/CMakeFiles/CMakeOutput.log
build/Testing/Temporary/LastTest.log
build-bench-asan/CMakeFiles/CMakeOutput.log
build-bench-asan/Testing/Temporary/LastTest.log
if-no-files-found: ignore
emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git submodule update --init --recursive
- uses: mymindstorm/setup-emsdk@v14
with:
version: 'latest'
- name: Configure (Node target)
run: |
emcmake cmake -S . -B build-ems \
-DCMAKE_BUILD_TYPE=Release \
-DLOGIT_CPP_BUILD_TESTS=ON \
-DLOGIT_EMSCRIPTEN=ON -DLOGIT_FORCE_ASYNC_OFF=ON
- name: Build
run: cmake --build build-ems --target ems_console ems_async_flush ems_single_thread_executor -j
- name: Run smoke tests
run: |
node --no-experimental-fetch build-ems/tests/ems_console.js
node --no-experimental-fetch build-ems/tests/ems_async_flush.js
node --no-experimental-fetch build-ems/tests/ems_single_thread_executor.js
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: emscripten-logs
path: |
build-ems/CMakeFiles/CMakeOutput.log
build-ems/Testing/Temporary/LastTest.log
if-no-files-found: ignore