-
Notifications
You must be signed in to change notification settings - Fork 94
642 lines (641 loc) · 25 KB
/
ci.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
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
name: "MiNiFi-CPP CI"
on: [push, pull_request, workflow_dispatch]
env:
DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
-DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_BUILD_ONLY=ON
SCCACHE_GHA_ENABLE: true
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
jobs:
macos_xcode:
name: "macos-xcode"
runs-on: macos-14
timeout-minutes: 180
env:
MACOS_MINIFI_OPTIONS: >-
-DCMAKE_BUILD_TYPE=Release
-DCI_BUILD=ON
-DCUSTOM_MALLOC=OFF
-DDOCKER_BUILD_ONLY=OFF
-DDOCKER_PUSH=OFF
-DDOCKER_SKIP_TESTS=ON
-DENABLE_ALL=OFF
-DENABLE_AWS=ON
-DENABLE_AZURE=ON
-DENABLE_BUSTACHE=OFF
-DENABLE_BZIP2=ON
-DENABLE_CIVET=ON
-DENABLE_CONTROLLER=ON
-DENABLE_ELASTICSEARCH=ON
-DENABLE_ENCRYPT_CONFIG=ON
-DENABLE_EXPRESSION_LANGUAGE=ON
-DENABLE_GCP=ON
-DENABLE_KUBERNETES=ON
-DENABLE_LIBARCHIVE=ON
-DENABLE_LIBRDKAFKA=ON
-DENABLE_LUA_SCRIPTING=ON
-DENABLE_LZMA=ON
-DENABLE_MQTT=ON
-DENABLE_OPC=ON
-DENABLE_OPENCV=ON
-DENABLE_OPS=ON
-DENABLE_PROMETHEUS=ON
-DENABLE_PYTHON_SCRIPTING=ON
-DENABLE_ROCKSDB=ON
-DENABLE_SFTP=OFF
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DENABLE_TEST_PROCESSORS=OFF
-DFORCE_COLORED_OUTPUT=OFF
-DLIBC_STATIC=OFF
-DMINIFI_ADVANCED_ASAN_BUILD=OFF
-DMINIFI_ADVANCED_CODE_COVERAGE=OFF
-DMINIFI_FAIL_ON_WARNINGS=OFF
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=ON
-DPORTABLE=ON
-DSKIP_TESTS=OFF
-DUSE_SHARED_LIBS=ON
steps:
- id: checkout
uses: actions/checkout@v4
- name: cache restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: macos-arm-xcode-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
macos-arm-xcode-ccache-${{github.ref}}-
macos-arm-xcode-ccache-refs/heads/main-
- id: install_dependencies
run: |
brew update
brew install ossp-uuid bison flex ccache sqliteodbc automake autoconf ninja
- id: setup_env
name: setup enviroment
run: |
echo "PATH=/opt/homebrew/opt/ccache:/opt/homebrew/opt/ccache/bin:/opt/homebrew/opt/ccache/libexec:$PATH" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$(brew --prefix)/lib" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: |
python -m venv venv && source venv/bin/activate && pip install -r requirements.txt && python main.py --noninteractive --skip-compiler-install --cmake-options="-DCMAKE_C_FLAGS=${CPPFLAGS} ${CFLAGS} -DCMAKE_CXX_FLAGS=${CPPFLAGS} ${CXXFLAGS}" --minifi-options="${MACOS_MINIFI_OPTIONS}"
working-directory: bootstrap
- name: cache save
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: macos-arm-xcode-ccache-${{github.ref}}-${{github.sha}}
- name: test
id: test
run: |
# Set core file size limit to unlimited
ulimit -c unlimited
ctest -j4 --output-on-failure --timeout 300
working-directory: build
- name: linter
run: ninja linter
working-directory: build
- name: check-cores
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |
if [ "$(ls -A /cores)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: macos-coredumps
path: /cores
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: macos-binaries
path: build/bin
windows_VS2022:
name: "windows-2022"
runs-on: windows-2022
timeout-minutes: 240
env:
WINDOWS_MINIFI_OPTIONS: >-
-DCMAKE_BUILD_TYPE=Release
-DBUILD_ROCKSDB=ON
-DBUILD_SHARED_LIBS=OFF
-DCI_BUILD=ON
-DCUSTOM_MALLOC=OFF
-DDOCKER_BUILD_ONLY=OFF
-DDOCKER_PUSH=OFF
-DDOCKER_SKIP_TESTS=ON
-DENABLE_ALL=OFF
-DENABLE_AWS=ON
-DENABLE_AZURE=ON
-DENABLE_BUSTACHE=OFF
-DENABLE_BZIP2=ON
-DENABLE_CIVET=ON
-DENABLE_CONTROLLER=ON
-DENABLE_COVERAGE=
-DENABLE_ELASTICSEARCH=ON
-DENABLE_ENCRYPT_CONFIG=ON
-DENABLE_EXPRESSION_LANGUAGE=ON
-DENABLE_GCP=ON
-DENABLE_GRAFANA_LOKI=ON
-DENABLE_KUBERNETES=ON
-DENABLE_LIBARCHIVE=ON
-DENABLE_LIBRDKAFKA=ON
-DENABLE_LUA_SCRIPTING=ON
-DENABLE_LZMA=ON
-DENABLE_MQTT=ON
-DENABLE_OPC=ON
-DENABLE_OPENCV=OFF
-DENABLE_OPS=ON
-DENABLE_PDH=ON
-DENABLE_PROMETHEUS=ON
-DENABLE_PYTHON_SCRIPTING=ON
-DENABLE_ROCKSDB=ON
-DENABLE_SFTP=OFF
-DENABLE_SMB=ON
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DENABLE_TEST_PROCESSORS=OFF
-DENABLE_WEL=ON
-DFORCE_COLORED_OUTPUT=ON
-DINSTALLER_MERGE_MODULES=OFF
-DMINIFI_FAIL_ON_WARNINGS=ON
-DMSI_REDISTRIBUTE_UCRT_NONASL=OFF
-DPORTABLE=ON
-DSKIP_TESTS=OFF
-DSTATIC_BUILD=ON
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=ON
-DUSE_SHARED_LIBS=OFF
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- name: Checkout project
uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache/restore@v4
with:
path: ~/AppData/Local/Mozilla/sccache/cache
key: ${{ runner.os }}-2022-sccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-2022-sccache-${{ github.ref }}
${{ runner.os }}-2022-sccache-refs/heads/main
${{ runner.os }}-2022-sccache
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Set up Python
run: choco -y install python & refreshenv
shell: cmd
- name: Install sqliteodbc driver
run: |
Invoke-WebRequest -Uri "http://www.ch-werner.de/sqliteodbc/sqliteodbc_w64.exe" -OutFile "sqliteodbc_w64.exe"
if ((Get-FileHash 'sqliteodbc_w64.exe').Hash -ne "a4804e4f54f42c721df1323c5fcac101a8c7a577e7f20979227324ceab572d51") {Write "Hash mismatch"; Exit 1}
Start-Process -FilePath ".\sqliteodbc_w64.exe" -ArgumentList "/S" -Wait
shell: powershell
- name: Add sccache to path
run: '[Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + ";" + (Split-Path -Path $env:SCCACHE_PATH -Parent), [EnvironmentVariableTarget]::Machine);'
shell: powershell
- name: Install jom
run: |
Invoke-WebRequest -Uri "http://download.qt.io/official_releases/jom/jom_1_1_4.zip" -OutFile "jom.zip"
if ((Get-FileHash 'jom.zip').Hash -ne "d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b") {Write "Hash mismatch"; Exit 1}
New-Item -ItemType Directory -Path D:\jom
Expand-Archive -Path jom.zip -DestinationPath D:\jom
[Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + ";D:\jom", [EnvironmentVariableTarget]::Machine);
shell: powershell
- name: build
run: |
python -m venv venv & venv\Scripts\activate & pip install -r requirements.txt & python main.py --noninteractive --skip-compiler-install --minifi-options="%WINDOWS_MINIFI_OPTIONS%" --cmake-options="-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
shell: cmd
working-directory: bootstrap
- name: Save cache
uses: actions/cache/save@v4
if: always()
with:
path: ~/AppData/Local/Mozilla/sccache/cache
key: ${{ runner.os }}-2022-sccache-${{ github.ref }}-${{ github.sha }}
- name: Run tests
run: ctest --timeout 300 --parallel %NUMBER_OF_PROCESSORS% -C Release --output-on-failure
shell: cmd
working-directory: ./build
- name: Run linter
run: cmake --build . --target linter --config Release -j 8
shell: cmd
working-directory: ./build
- name: Upload artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: cpack_error
path: D:/a/nifi-minifi-cpp/nifi-minifi-cpp/build/_CPack_Packages/win64/WIX/wix.log
ubuntu_24_04:
name: "ubuntu-24.04"
runs-on: ubuntu-24.04
timeout-minutes: 120
env:
UBUNTU_GCC_MINIFI_OPTIONS: >-
-DCMAKE_BUILD_TYPE=Release
-DCI_BUILD=OFF
-DCUSTOM_MALLOC=OFF
-DDOCKER_BUILD_ONLY=OFF
-DDOCKER_PUSH=OFF
-DDOCKER_SKIP_TESTS=ON
-DENABLE_ALL=OFF
-DENABLE_AWS=OFF
-DENABLE_AZURE=OFF
-DENABLE_BUSTACHE=ON
-DENABLE_BZIP2=ON
-DENABLE_CIVET=ON
-DENABLE_CONTROLLER=ON
-DENABLE_ELASTICSEARCH=OFF
-DENABLE_ENCRYPT_CONFIG=ON
-DENABLE_EXPRESSION_LANGUAGE=ON
-DENABLE_GCP=OFF
-DENABLE_KUBERNETES=OFF
-DENABLE_LIBARCHIVE=ON
-DENABLE_LIBRDKAFKA=OFF
-DENABLE_LUA_SCRIPTING=OFF
-DENABLE_LZMA=ON
-DENABLE_MQTT=OFF
-DENABLE_OPC=OFF
-DENABLE_OPENCV=OFF
-DENABLE_OPS=ON
-DENABLE_PROCFS=OFF
-DENABLE_PROMETHEUS=ON
-DENABLE_PYTHON_SCRIPTING=OFF
-DENABLE_ROCKSDB=ON
-DENABLE_SFTP=ON
-DENABLE_SPLUNK=OFF
-DENABLE_SQL=OFF
-DENABLE_SYSTEMD=ON
-DENABLE_TEST_PROCESSORS=OFF
-DFORCE_COLORED_OUTPUT=ON
-DMINIFI_FAIL_ON_WARNINGS=ON
-DPORTABLE=ON
-DSKIP_TESTS=OFF
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF
-DUSE_SHARED_LIBS=ON
steps:
- id: checkout
uses: actions/checkout@v4
- name: cache restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ubuntu-24.04-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-24.04-ccache-${{github.ref}}-
ubuntu-24.04-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache libfl-dev python3 python3-venv
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: |
python3 -m venv venv && source venv/bin/activate \
&& pip install -r requirements.txt \
&& python main.py --noninteractive --minifi-options="${UBUNTU_GCC_MINIFI_OPTIONS}" --cmake-options="-DSTRICT_GSL_CHECKS=AUDIT"
working-directory: bootstrap
- name: cache save
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: ubuntu-24.04-ccache-${{github.ref}}-${{github.sha}}
- name: test
id: test
run: |
# Set core file size limit to unlimited
ulimit -c unlimited
ctest -j$(nproc) --output-on-failure
working-directory: build
- name: check-cores
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |
if [ "$(ls -A /var/lib/apport/coredump/)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: ubuntu-coredumps
path: /var/lib/apport/coredump/
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: ubuntu-binaries
path: build/bin
ubuntu_22_04_clang:
name: "ubuntu-22.04-clang"
runs-on: ubuntu-22.04
timeout-minutes: 240
env:
UBUNTU_CLANG_MINIFI_OPTIONS: >-
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCI_BUILD=OFF
-DCUSTOM_MALLOC=OFF
-DDOCKER_BUILD_ONLY=OFF
-DDOCKER_PUSH=OFF
-DDOCKER_SKIP_TESTS=ON
-DENABLE_ALL=OFF
-DENABLE_AWS=ON
-DENABLE_AZURE=ON
-DENABLE_BUSTACHE=ON
-DENABLE_BZIP2=ON
-DENABLE_CIVET=ON
-DENABLE_CONTROLLER=ON
-DENABLE_ELASTICSEARCH=ON
-DENABLE_ENCRYPT_CONFIG=ON
-DENABLE_EXPRESSION_LANGUAGE=ON
-DENABLE_EXECUTE_PROCESS=ON
-DENABLE_GCP=ON
-DENABLE_GRAFANA_LOKI=ON
-DENABLE_KUBERNETES=ON
-DENABLE_LIBARCHIVE=ON
-DENABLE_LIBRDKAFKA=ON
-DENABLE_LUA_SCRIPTING=ON
-DENABLE_LZMA=ON
-DENABLE_MQTT=ON
-DENABLE_OPC=ON
-DENABLE_OPENCV=ON
-DENABLE_OPS=ON
-DENABLE_PROCFS=ON
-DENABLE_PROMETHEUS=ON
-DENABLE_PYTHON_SCRIPTING=ON
-DENABLE_ROCKSDB=ON
-DENABLE_SFTP=ON
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DENABLE_SYSTEMD=ON
-DENABLE_TEST_PROCESSORS=OFF
-DFORCE_COLORED_OUTPUT=ON
-DMINIFI_FAIL_ON_WARNINGS=ON
-DPORTABLE=ON
-DSKIP_TESTS=OFF
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF
-DUSE_SHARED_LIBS=ON
steps:
- id: checkout
uses: actions/checkout@v4
- name: cache restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ubuntu-22.04-all-clang-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-22.04-all-clang-ccache-${{github.ref}}-
ubuntu-22.04-all-clang-ccache-refs/heads/main-
- id: install_deps
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y ccache libfl-dev clang-16 clang-tidy-16 libc++-16-dev libc++abi-16-dev libc++1-16 libc++abi1-16 libunwind-16 libsqliteodbc flake8 parallel
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- id: free_disk_space
run: |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions:
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: build
run: |
export CC=clang-16
export CXX=clang++-16
export CXXFLAGS="-stdlib=libc++"
export LDFLAGS="-stdlib=libc++"
python3 -m venv venv && source venv/bin/activate \
&& pip install -r requirements.txt \
&& python main.py --noninteractive --skip-compiler-install --cmake-options="-DSTRICT_GSL_CHECKS=AUDIT -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" --minifi-options="${UBUNTU_CLANG_MINIFI_OPTIONS}"
working-directory: bootstrap
- id: cache_save
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: ubuntu-22.04-all-clang-ccache-${{github.ref}}-${{github.sha}}
- name: test
id: test
run: |
# Set core file size limit to unlimited
ulimit -c unlimited
ctest -j$(nproc) --output-on-failure
working-directory: build
- name: linter
run: cmake --build . --target linter
working-directory: ./build
- name: shellcheck
run: cmake --build . --target shellcheck
working-directory: ./build
- id: flake8_check
run: cmake --build . --target flake8
working-directory: ./build
- id: files
uses: Ana06/[email protected]
continue-on-error: true
- name: clang-tidy
run: |
if [[ -n "${{ steps.files.outputs.all }}" ]]; then
FILES="${{ steps.files.outputs.all }}"
else
git fetch origin main && git checkout -b main origin/main || true
FILES=$(git diff --name-only main ${{ github.sha }} --)
git checkout ${{ github.sha }}
fi
# https://stackoverflow.com/questions/58466701/clang-tidy-cant-locate-stdlib-headers
sed -i -e 's/\/usr\/lib\/ccache\/clang++-16/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/clang-16/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/c++/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json
sed -i -e 's/\/usr\/lib\/ccache\/cc/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json
parallel -j$(( $(nproc) + 1 )) ./run_clang_tidy.sh ::: ${FILES}
- name: check-cores
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |
if [ "$(ls -A /var/lib/apport/coredump/)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: ubuntu-clang-coredumps
path: /var/lib/apport/coredump/
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: ubuntu-clang-binaries
path: build/bin
rocky:
name: "rocky"
runs-on: ubuntu-20.04
timeout-minutes: 180
steps:
- id: checkout
uses: actions/checkout@v4
- name: cache restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: rocky-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
rocky-ccache-${{github.ref}}-
rocky-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: free_disk_space
run: |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions:
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- id: build
run: |
# rocky build can run out of the github runners' disk space if built with RelWithDebInfo so we keep the Release build here
mkdir build && cd build && cmake -DUSE_SHARED_LIBS=ON -DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DSTRICT_GSL_CHECKS=AUDIT -DMINIFI_FAIL_ON_WARNINGS=OFF -DENABLE_AWS=ON -DENABLE_AZURE=ON \
-DENABLE_ENCRYPT_CONFIG=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \
-DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_GCP=ON -DENABLE_PROCFS=ON -DENABLE_PROMETHEUS=ON \
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_SKIP_TESTS=OFF -DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} .. && make rocky-test
- name: cache save
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: rocky-ccache-${{github.ref}}-${{github.sha}}
- id: test
run: |
# Set core file size limit to unlimited
ulimit -c unlimited
echo '/cores/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern
sudo mkdir /cores
sudo chmod 777 /cores
docker run --name rocky-test --init --ulimit core=-1 --mount type=bind,source=/cores,target=/cores apacheminificpp:$(docker images | grep apacheminificpp | grep rocky | awk '{print $2}') bash -c 'cd /opt/minifi/build && make test ARGS="--timeout 300 -j8 --output-on-failure"'
- name: check-cores
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |
if [ "$(ls -A /cores)" ]; then
echo "CORES_EXIST=true" >> $GITHUB_ENV;
docker cp rocky-test:/opt/minifi/build/bin /tmp
sudo chmod -R 777 /cores
fi
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: rocky-crashes
path: /cores
- uses: actions/upload-artifact@v4
if: ${{ failure() && env.CORES_EXIST == 'true' }}
with:
name: rocky-binaries
path: /tmp/bin
docker_build:
name: "Docker build for integration tests"
runs-on: ubuntu-22.04
timeout-minutes: 180
steps:
- id: checkout
uses: actions/checkout@v4
- name: cache restore
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: docker-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
docker-ccache-${{github.ref}}-
docker-ccache-refs/heads/main
- id: free_disk_space
run: |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions:
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- id: build
run: |
mkdir build
cd build
cmake ${DOCKER_CMAKE_FLAGS} -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} ..
make docker
- name: cache save
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: docker-ccache-${{github.ref}}-${{github.sha}}
- name: Save docker image
run: cd build && docker save -o minifi_docker.tar apacheminificpp:$(grep CMAKE_PROJECT_VERSION:STATIC CMakeCache.txt | cut -d "=" -f2)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: minifi_docker
path: build/minifi_docker.tar
docker_tests:
name: "Docker integration tests"
needs: docker_build
runs-on: ubuntu-20.04
timeout-minutes: 180
steps:
- id: checkout
uses: actions/checkout@v4
- id: run_cmake
name: Run CMake
run: |
mkdir build
cd build
cmake ${DOCKER_CMAKE_FLAGS} ..
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: minifi_docker
path: build
- name: Load Docker image
run: |
docker load --input ./build/minifi_docker.tar
- id: install_deps
name: Install dependencies for Docker Verify
run: |
sudo apt update
sudo apt install -y python3-virtualenv
- id: free_disk_space
run: |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions:
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- id: test
name: Docker Verify
working-directory: ./build
run: make docker-verify
- name: Test Reporter
if: always()
uses: phoenix-actions/test-reporting@v15
with:
name: Docker integration tests
path: build/behavex_output/behave/*.xml
reporter: java-junit
output-to: 'step-summary'
only-summary: 'true'
list-tests: 'failed'
list-suites: 'failed'
- name: Upload artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: behavex_output
path: build/behavex_output