-
Notifications
You must be signed in to change notification settings - Fork 1
316 lines (304 loc) · 12.4 KB
/
Copy pathci.yml
File metadata and controls
316 lines (304 loc) · 12.4 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
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_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
- 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: 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-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
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 }}-${{ 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: Validate port
if: matrix.suite == 'vcpkg-install'
run: |
./vcpkg/vcpkg install log-it-cpp \
--overlay-ports=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 }}-${{ 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