-
Notifications
You must be signed in to change notification settings - Fork 0
1492 lines (1302 loc) · 53 KB
/
Copy pathci.yml
File metadata and controls
1492 lines (1302 loc) · 53 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
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
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build-linux-gcc:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset debug
- name: Build and test
run: cmake --build --preset debug --target junit BddTargetTests SolidSyslogBddTarget
- name: Run BDD target tests
run: cd build/debug && ./Tests/Bdd/Targets/BddTargetTests -ojunit -k BddTargetTests
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (GCC)
path: build/debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-build-linux-gcc
path: build/debug/cpputest_*.xml
retention-days: 1
- name: Upload BDD target binaries
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: solid-syslog-bdd-targets
path: |
build/debug/Bdd/Targets/SolidSyslogBddTarget
retention-days: 1
compression-level: 0
# BDD-side mirror of build-time tunables, generated by configure_file.
# bdd-linux-syslog-ng downloads this into Bdd/features/steps/ so behave
# can `import solidsyslog_tunables` (the file is gitignored, not in checkout).
- name: Upload BDD Python tunables (Linux)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bdd-tunables-linux
path: Bdd/features/steps/solidsyslog_tunables.py
retention-days: 1
integration-linux-openssl:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset debug
- name: Build integration tests
run: cmake --build --preset debug --target OpenSslIntegrationTests
- name: Run integration tests
run: cd build/debug && ./Tests/OpenSslIntegration/OpenSslIntegrationTests -v -ojunit -k OpenSslIntegrationTests
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (OpenSSL Integration)
path: build/debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-integration-linux-openssl
path: build/debug/cpputest_*.xml
retention-days: 1
integration-linux-mbedtls:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
# cpputest-freertos image carries /opt/mbedtls (and exports MBEDTLS_DIR);
# Tests/MbedTlsIntegration/CMakeLists.txt requires that env var.
container:
image: ghcr.io/davidcozens/cpputest-freertos:sha-0b93766
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset debug
- name: Build integration tests
run: cmake --build --preset debug --target MbedTlsIntegrationTests
- name: Run integration tests
run: cd build/debug && ./Tests/MbedTlsIntegration/MbedTlsIntegrationTests -v -ojunit -k MbedTlsIntegrationTests
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (mbedTLS Integration)
path: build/debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-integration-linux-mbedtls
path: build/debug/cpputest_*.xml
retention-days: 1
integration-windows-openssl:
runs-on: windows-latest
permissions:
contents: read
checks: write
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Enable vcpkg binary cache
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Cache vcpkg's classic-mode installed tree across runs and branches.
# x-gha (above) is per-workflow scope and goes cold on a fresh branch;
# actions/cache survives across branches with a static key. Bump the
# `v1` suffix to force a rebuild (e.g. when adding a package).
# C:\vcpkg is the standard VCPKG_INSTALLATION_ROOT on github-hosted
# windows runners — hardcoded here so the cache step doesn't depend
# on a runner-image-set env var (the linter can't see those).
- name: Cache vcpkg installed tree
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
# The cache is a pure speed optimisation — a flaky restore must never
# skip the build+test. actions/cache can fail mid-restore (even after
# reporting a hit); without continue-on-error that failure trips the
# default `if: success()` on every following step, so Install / Configure
# / Build-and-test all skip and the job goes red without ever compiling.
# On a miss or partial restore the `vcpkg install` below rebuilds the
# tree (backed by the x-gha binary cache), so the only cost is a slower
# run.
continue-on-error: true
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-cpputest-openssl-v1
- name: Install CppUTest and OpenSSL
run: |
vcpkg install cpputest openssl
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
- name: Configure
run: cmake --preset msvc-debug
- name: Build integration tests
run: cmake --build --preset msvc-debug --target OpenSslIntegrationTests
- name: Run integration tests
shell: pwsh
run: |
Set-Location build/msvc-debug/Tests/OpenSslIntegration/Debug
./OpenSslIntegrationTests.exe -v -ojunit -k OpenSslIntegrationTests
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (OpenSSL Integration Windows)
path: build/msvc-debug/Tests/OpenSslIntegration/Debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-integration-windows-openssl
path: build/msvc-debug/Tests/OpenSslIntegration/Debug/cpputest_*.xml
retention-days: 1
build-linux-tunable-override:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure with tunable override
run: cmake --preset tunable-override-debug
- name: Build and test
run: cmake --build --preset tunable-override-debug --target junit
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (Tunable Override)
path: build/tunable-override-debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-build-linux-tunable-override
path: build/tunable-override-debug/cpputest_*.xml
retention-days: 1
build-linux-clang:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
container:
image: ghcr.io/davidcozens/cpputest-clang:sha-7eac3ab
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset clang-debug
- name: Build and test
run: cmake --build --preset clang-debug --target junit
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (Clang)
path: build/clang-debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-build-linux-clang
path: build/clang-debug/cpputest_*.xml
retention-days: 1
sanitize-linux-gcc:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset sanitize
- name: Build and test
run: cmake --build --preset sanitize --target junit
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (Sanitize)
path: build/sanitize/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-sanitize-linux-gcc
path: build/sanitize/cpputest_*.xml
retention-days: 1
coverage-linux-gcc:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pages: write
id-token: write
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset coverage
- name: Build and generate coverage report
run: cmake --build --preset coverage --target coverage
- name: Post coverage summary
run: |
echo '## Coverage Summary' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
lcov --summary build/coverage/coverage.filtered.info --rc branch_coverage=1 2>&1 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Enforce coverage thresholds
env:
LINE_THRESHOLD: 90
BRANCH_THRESHOLD: 90
run: |
SUMMARY=$(lcov --summary build/coverage/coverage.filtered.info --rc branch_coverage=1 2>&1)
LINE_COV=$(echo "$SUMMARY" | sed -n 's/.*lines\.*: \([0-9.]*\)%.*/\1/p')
BRANCH_COV=$(echo "$SUMMARY" | sed -n 's/.*branches\.*: \([0-9.]*\)%.*/\1/p')
FAIL=0
if [ -n "$LINE_COV" ]; then
echo "Line coverage: ${LINE_COV}% (threshold: ${LINE_THRESHOLD}%)"
if awk "BEGIN{exit !($LINE_COV < $LINE_THRESHOLD)}"; then
echo "FAIL: line coverage ${LINE_COV}% is below ${LINE_THRESHOLD}%"
FAIL=1
fi
else
echo "FAIL: could not determine line coverage"
FAIL=1
fi
if [ -n "$BRANCH_COV" ]; then
echo "Branch coverage: ${BRANCH_COV}% (threshold: ${BRANCH_THRESHOLD}%)"
if awk "BEGIN{exit !($BRANCH_COV < $BRANCH_THRESHOLD)}"; then
echo "FAIL: branch coverage ${BRANCH_COV}% is below ${BRANCH_THRESHOLD}%"
FAIL=1
fi
else
echo "Branch coverage: no branch data found (skipping threshold check)"
fi
exit $FAIL
- name: Upload pages artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: build/coverage/coverage_report/
deploy-coverage-pages:
needs: coverage-linux-gcc
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
analyze-tidy:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset tidy
- name: Build with clang-tidy
shell: bash
run: set -o pipefail && cmake --build --preset tidy 2>&1 | tee build/tidy/clang-tidy-output.txt
- name: Upload clang-tidy output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: clang-tidy-report
path: build/tidy/clang-tidy-output.txt
retention-days: 1
analyze-iwyu:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest-clang:sha-7eac3ab
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset iwyu
# IWYU is advisory: the two-pass "should add / should remove" output is
# hard to interpret correctly under time pressure, and the per-PR
# friction it causes outweighs the steady-state value (S24.13 / E24).
# Findings still surface via the uploaded artifact below; release prep
# is responsible for clearing them.
- name: Run include-what-you-use (advisory)
shell: bash
continue-on-error: true
run: set -o pipefail && cmake --build --preset iwyu --target iwyu 2>&1 | tee build/iwyu/iwyu-output.txt
- name: Upload iwyu output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: iwyu-report
path: build/iwyu/iwyu-output.txt
retention-days: 1
# Mirrors analyze-tidy but runs on cpputest-freertos so the Platform/{FreeRtos,
# PlusTcp,LwipRaw,MbedTls,FatFs} trees and their Tests/* siblings enter the
# CMake configure (gated by FREERTOS_KERNEL_PATH / MBEDTLS_DIR / LWIP_PATH /
# FATFS_PATH, all set in the freertos image). The base lane on cpputest skips
# those trees because the env vars are absent.
analyze-tidy-freertos-plustcp:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest-freertos:sha-0b93766
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset tidy
- name: Build with clang-tidy
shell: bash
run: set -o pipefail && cmake --build --preset tidy 2>&1 | tee build/tidy/clang-tidy-output.txt
- name: Upload clang-tidy output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: clang-tidy-report-freertos-plustcp
path: build/tidy/clang-tidy-output.txt
retention-days: 1
# Same freertos coverage rationale as analyze-tidy-freertos-plustcp. Overrides
# CMAKE_C_COMPILER explicitly to clang-19 because the cpputest-freertos image
# (chained from the cpputest gcc base) ships clang-19/clang++-19 but no
# `clang`/`clang++` alternative — only the cpputest-clang image creates that
# alias. A future image bump could add the alternative to the gcc base and
# drop these overrides.
analyze-iwyu-freertos-plustcp:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest-freertos:sha-0b93766
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset iwyu -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
# Advisory per S24.13 — see analyze-iwyu above for rationale.
- name: Run include-what-you-use (advisory)
shell: bash
continue-on-error: true
run: set -o pipefail && cmake --build --preset iwyu --target iwyu 2>&1 | tee build/iwyu/iwyu-output.txt
- name: Upload iwyu output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: iwyu-report-freertos-plustcp
path: build/iwyu/iwyu-output.txt
retention-days: 1
# NET=LWIP twin of analyze-tidy-freertos-plustcp. Same cpputest-freertos image
# and tidy preset, but SOLIDSYSLOG_FREERTOS_NET=LWIP so the configure exercises
# the lwIP wiring path (Platform/PlusTcp library target dropped; the LwipRaw
# adapter pack is the active FreeRTOS networking backend). Guards the NET=LWIP
# configure + the LwipRaw tree / Tests under clang-tidy as a named required check.
analyze-tidy-freertos-lwip:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest-freertos:sha-0b93766
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset tidy -DSOLIDSYSLOG_FREERTOS_NET=LWIP
- name: Build with clang-tidy
shell: bash
run: set -o pipefail && cmake --build --preset tidy 2>&1 | tee build/tidy/clang-tidy-output.txt
- name: Upload clang-tidy output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: clang-tidy-report-freertos-lwip
path: build/tidy/clang-tidy-output.txt
retention-days: 1
# NET=LWIP twin of analyze-iwyu-freertos-plustcp — see that lane for the
# clang-19 override rationale and analyze-tidy-freertos-lwip for the NET scope.
# Advisory per S24.13.
analyze-iwyu-freertos-lwip:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest-freertos:sha-0b93766
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset iwyu -DSOLIDSYSLOG_FREERTOS_NET=LWIP -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19
# Advisory per S24.13 — see analyze-iwyu above for rationale.
- name: Run include-what-you-use (advisory)
shell: bash
continue-on-error: true
run: set -o pipefail && cmake --build --preset iwyu --target iwyu 2>&1 | tee build/iwyu/iwyu-output.txt
- name: Upload iwyu output
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: iwyu-report-freertos-lwip
path: build/iwyu/iwyu-output.txt
retention-days: 1
analyze-format:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Check clang-format
run: |
find Core/Interface Core/Source Platform Tests Bdd/Targets -name '*.c' -o -name '*.cpp' -o -name '*.h' \
| xargs clang-format --dry-run --Werror
analyze-cppcheck:
runs-on: ubuntu-latest
container:
image: ghcr.io/davidcozens/cpputest:sha-2c7b76b
options: --user root
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: safe.directory
GIT_CONFIG_VALUE_0: '*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Configure
run: cmake --preset cppcheck
- name: Build with cppcheck
run: cmake --build --preset cppcheck
- name: Generate cppcheck XML report
if: success() || failure()
run: >
cppcheck
--enable=warning,style,performance,portability
--suppress=missingIncludeSystem
--suppressions-list=cppcheck_suppressions_tests.txt
--inline-suppr
--std=c11
-ICore/Interface
-IPlatform/Atomics/Interface
-IPlatform/Posix/Interface
-IPlatform/Windows/Interface
-IPlatform/OpenSsl/Interface
-IPlatform/MbedTls/Interface
-IPlatform/FreeRtos/Interface
-IPlatform/PlusTcp/Interface
-IPlatform/LwipRaw/Interface
-IPlatform/FatFs/Interface
-IPlatform/PlusFat/Interface
--xml --xml-version=2
Core/Source/
Platform/Atomics/Source/
Platform/Posix/Source/
Platform/Windows/Source/
Platform/OpenSsl/Source/
Platform/MbedTls/Source/
Platform/FreeRtos/Source/
Platform/PlusTcp/Source/
Platform/LwipRaw/Source/
Platform/FatFs/Source/
Platform/PlusFat/Source/
2> build/cppcheck/cppcheck-report.xml
- name: Upload cppcheck report
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cppcheck-report
path: build/cppcheck/cppcheck-report.xml
retention-days: 1
# ----------------------------------------------------------------
# cppcheck-misra addon — runs the MISRA C:2012 addon over Strict +
# Pragmatic tiers (Core/Source/ + Platform/*/Source/). Findings
# fail CI (--error-exitcode=1); suppressions live in
# misra_suppressions.txt with rationales in docs/misra-deviations.md.
# ----------------------------------------------------------------
- name: Run cppcheck-misra
if: success() || failure()
run: >
cppcheck
--addon=misra
--suppressions-list=misra_suppressions.txt
--error-exitcode=1
--inline-suppr
--std=c11
-ICore/Interface
-IPlatform/Atomics/Interface
-IPlatform/Posix/Interface
-IPlatform/Windows/Interface
-IPlatform/OpenSsl/Interface
-IPlatform/MbedTls/Interface
-IPlatform/FreeRtos/Interface
-IPlatform/PlusTcp/Interface
-IPlatform/LwipRaw/Interface
-IPlatform/FatFs/Interface
-IPlatform/PlusFat/Interface
Core/Source/
Platform/Atomics/Source/
Platform/Posix/Source/
Platform/Windows/Source/
Platform/OpenSsl/Source/
Platform/MbedTls/Source/
Platform/FreeRtos/Source/
Platform/PlusTcp/Source/
Platform/LwipRaw/Source/
Platform/FatFs/Source/
Platform/PlusFat/Source/
- name: Generate cppcheck-misra XML report
if: success() || failure()
run: |
mkdir -p build/cppcheck-misra
cppcheck \
--addon=misra \
--suppressions-list=misra_suppressions.txt \
--error-exitcode=1 \
--inline-suppr \
--std=c11 \
-ICore/Interface \
-IPlatform/Atomics/Interface \
-IPlatform/Posix/Interface \
-IPlatform/Windows/Interface \
-IPlatform/OpenSsl/Interface \
-IPlatform/MbedTls/Interface \
-IPlatform/FreeRtos/Interface \
-IPlatform/PlusTcp/Interface \
-IPlatform/LwipRaw/Interface \
-IPlatform/FatFs/Interface \
-IPlatform/PlusFat/Interface \
--xml --xml-version=2 \
Core/Source/ \
Platform/Atomics/Source/ \
Platform/Posix/Source/ \
Platform/Windows/Source/ \
Platform/OpenSsl/Source/ \
Platform/MbedTls/Source/ \
Platform/FreeRtos/Source/ \
Platform/PlusTcp/Source/ \
Platform/LwipRaw/Source/ \
Platform/FatFs/Source/ \
Platform/PlusFat/Source/ \
2> build/cppcheck-misra/cppcheck-misra-report.xml
- name: Upload cppcheck-misra report
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cppcheck-misra-report
path: build/cppcheck-misra/cppcheck-misra-report.xml
retention-days: 1
build-windows-msvc:
runs-on: windows-latest
permissions:
contents: read
checks: write
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Enable vcpkg binary cache
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Same cache as integration-windows-openssl — both jobs share one
# entry. See that job's comment for rationale and key-bump policy.
- name: Cache vcpkg installed tree
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
# The cache is a pure speed optimisation — a flaky restore must never
# skip the build+test. actions/cache can fail mid-restore (even after
# reporting a hit); without continue-on-error that failure trips the
# default `if: success()` on every following step, so Install / Configure
# / Build-and-test all skip and the job goes red without ever compiling.
# On a miss or partial restore the `vcpkg install` below rebuilds the
# tree (backed by the x-gha binary cache), so the only cost is a slower
# run.
continue-on-error: true
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-cpputest-openssl-v1
- name: Install CppUTest and OpenSSL
run: |
vcpkg install cpputest openssl
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
- name: Configure
run: cmake --preset msvc-debug
- name: Build and test
run: cmake --build --preset msvc-debug --target junit SolidSyslogBddTarget
- name: Test Report
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (MSVC)
path: build/msvc-debug/cpputest_*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-build-windows-msvc
path: build/msvc-debug/cpputest_*.xml
retention-days: 1
- name: Upload Windows BDD target binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: solid-syslog-bdd-target-windows
path: build/msvc-debug/Bdd/Targets/Debug/SolidSyslogBddTarget.exe
retention-days: 1
compression-level: 0
- name: Upload BDD Python tunables (Windows)
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bdd-tunables-windows
path: Bdd/features/steps/solidsyslog_tunables.py
retention-days: 1
bdd-windows-otel:
needs: build-windows-msvc
runs-on: windows-2025
permissions:
contents: read
checks: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: solid-syslog-bdd-target-windows
path: build/msvc-debug/Bdd/Targets/Debug/
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bdd-tunables-windows
path: Bdd/features/steps/
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
- name: Install behave
run: pip install -r Bdd/requirements.txt
- name: Install otelcol-contrib
shell: pwsh
run: ./Bdd/otel/Install-OtelCollector.ps1
- name: Prepare BDD directories
run: mkdir -p Bdd/output Bdd/junit
- name: Start OTel Collector
# Use bash `&` backgrounding (what works locally) rather than pwsh
# Start-Process — the latter launched silently on windows-2025 with
# empty redirect files and no UDP bind, suggesting the child was
# either killed with the parent console or never actually executed.
run: |
nohup ./Bdd/otel/bin/otelcol-contrib.exe \
--config=Bdd/otel/config.yaml \
> Bdd/output/otelcol.out 2> Bdd/output/otelcol.err &
echo "otelcol backgrounded with PID $!"
- name: Wait for oracle to bind UDP 5514 + TCP 6514/6515
shell: pwsh
run: |
$deadline = (Get-Date).AddSeconds(30)
while ((Get-Date) -lt $deadline) {
$udp5514 = Get-NetUDPEndpoint -LocalPort 5514 -ErrorAction SilentlyContinue
$tcp6514 = Get-NetTCPConnection -LocalPort 6514 -State Listen -ErrorAction SilentlyContinue
$tcp6515 = Get-NetTCPConnection -LocalPort 6515 -State Listen -ErrorAction SilentlyContinue
if ($udp5514 -and $tcp6514 -and $tcp6515) {
Write-Host "otelcol is listening on UDP 5514 + TCP 6514 (TLS) + TCP 6515 (mTLS)"
exit 0
}
Start-Sleep -Milliseconds 500
}
Write-Host "otelcol did not bind all expected ports within 30 seconds"
Write-Host "--- tasklist otelcol-contrib ---"
tasklist /FI "IMAGENAME eq otelcol-contrib.exe"
Write-Host "--- UDP endpoints (top 20) ---"
Get-NetUDPEndpoint | Select-Object -First 20 | Format-Table -AutoSize
Write-Host "--- TCP listeners (top 20) ---"
Get-NetTCPConnection -State Listen | Select-Object -First 20 | Format-Table -AutoSize
Write-Host "--- Bdd/output contents ---"
Get-ChildItem Bdd/output -ErrorAction SilentlyContinue | Format-Table
Write-Host "--- otelcol.out ---"
Get-Content Bdd/output/otelcol.out -ErrorAction SilentlyContinue
Write-Host "--- otelcol.err ---"
Get-Content Bdd/output/otelcol.err -ErrorAction SilentlyContinue
exit 1
- name: Run BDD tests
env:
BDD_TARGET: windows
EXAMPLE_BINARY: build/msvc-debug/Bdd/Targets/Debug/SolidSyslogBddTarget.exe
RECEIVED_LOG: Bdd/output/received.jsonl
ORACLE_FORMAT: otel-jsonl
run: >
behave --junit --junit-directory Bdd/junit
--tags='not @wip and not @windows_wip and not @no_rtc and not @aesgcm'
Bdd/features/
- name: BDD Test Report (Windows)
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
if: success() || failure()
with:
name: Test Results (BDD Windows)
path: Bdd/junit/TESTS-*.xml
reporter: java-junit
- name: Upload JUnit XML
if: success() || failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: junit-bdd-windows-otel
path: Bdd/junit/TESTS-*.xml
retention-days: 1