Skip to content

Commit 2c666a4

Browse files
authored
Merge pull request #258 from CESNET/v5.0.0-cmake-plugins
V5.0.0 - Massive refactor: Plugin-based architecture, CMake, and CI overhaul
2 parents 9fe312a + e0affe0 commit 2c666a4

File tree

535 files changed

+41640
-44035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

535 files changed

+41640
-44035
lines changed

.clang-format

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ AlwaysBreakBeforeMultilineStrings: true
66
AlignAfterOpenBracket: AlwaysBreak
77
AllowAllArgumentsOnNextLine: false
88
AllowAllParametersOfDeclarationOnNextLine: false
9+
AllowShortIfStatementsOnASingleLine: Never
910
AllowShortFunctionsOnASingleLine: Inline
1011
AlwaysBreakTemplateDeclarations: Yes
1112
BinPackArguments: false
@@ -23,6 +24,16 @@ SpaceAfterTemplateKeyword: false
2324
SpaceInEmptyBlock: false
2425
SpacesInContainerLiterals: false
2526
PointerAlignment: Left
26-
UseTab: false
27-
IndentWidth: 4
27+
TabWidth: '4'
28+
UseTab: ForContinuationAndIndentation
29+
30+
SortIncludes: true
31+
IncludeBlocks: Regroup
32+
IncludeCategories:
33+
- Regex: '^"(.*)"$'
34+
Priority: 1
35+
- Regex: '^<[^>]*\.(h|hpp)>$'
36+
Priority: 3
37+
- Regex: '^<.*>$'
38+
Priority: 2
2839
...

.clang-tidy

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
Checks: '
3+
-*,
4+
bugprone-*,
5+
clang-analyzer-*,
6+
clang-diagnostic-*,
7+
concurrency-mt-unsafe,
8+
cppcoreguidelines-no-malloc,
9+
misc-*,
10+
modernize-*,
11+
performance-*,
12+
readability-*,
13+
-misc-include-cleaner,
14+
-misc-new-delete-overloads,
15+
-misc-no-recursion,
16+
-misc-use-anonymous-namespace,
17+
-modernize-use-trailing-return-type,
18+
-modernize-use-nodiscard,
19+
-modernize-avoid-c-arrays,
20+
-bugprone-easily-swappable-parameters,
21+
-bugprone-multi-level-implicit-pointer-conversion,
22+
-performance-enum-size,
23+
-readability-avoid-nested-conditional-operator'
24+
FormatStyle: file
25+
WarningsAsErrors: '*'
26+
27+
CheckOptions:
28+
- key: readability-identifier-naming.ClassCase
29+
value: 'CamelCase'
30+
- key: readability-identifier-naming.ClassConstantCase
31+
value: 'UPPER_CASE'
32+
- key: readability-identifier-naming.ClassMemberCase
33+
value: 'camelBack'
34+
- key: readability-identifier-naming.ClassMemberPrefix
35+
value: 's_'
36+
- key: readability-identifier-naming.ClassMethodCase
37+
value: 'camelBack'
38+
- key: readability-identifier-naming.ConstantMemberCase
39+
value: 'UPPER_CASE'
40+
- key: readability-identifier-naming.EnumConstantCase
41+
value: 'UPPER_CASE'
42+
- key: readability-identifier-naming.FunctionCase
43+
value: 'camelBack'
44+
- key: readability-identifier-naming.GlobalVariablePrefix
45+
value: 'g_'
46+
- key: readability-identifier-naming.GlobalConstantPrefix
47+
value: ''
48+
- key: readability-identifier-naming.MacroDefinitionCase
49+
value: 'UPPER_CASE'
50+
- key: readability-identifier-naming.MemberCase
51+
value: 'camelBack'
52+
- key: readability-identifier-naming.NamespaceCase
53+
value: 'lower_case'
54+
- key: readability-identifier-naming.ParameterCase
55+
value: 'camelBack'
56+
- key: readability-identifier-naming.PrivateMemberPrefix
57+
value: 'm_'
58+
- key: readability-identifier-naming.ProtectedMemberPrefix
59+
value: 'm_'
60+
- key: readability-identifier-naming.StructCase
61+
value: 'CamelCase'
62+
- key: readability-identifier-naming.TypeAliasCase
63+
value: 'CamelCase'
64+
- key: readability-identifier-naming.TypeAliasIgnoredRegexp
65+
value: '^.*_type$|^.*_category$|^.*reference$|^.*iterator$|^.*pointer$'
66+
- key: readability-identifier-naming.VariableCase
67+
value: 'camelBack'
68+
69+
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
70+
value: True
71+
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
72+
value: True
73+
- key: readability-magic-numbers.IgnoredIntegerValues
74+
value: '0;1;2;3;4;255;65535;4294967295'
75+
...

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[Makefile]
10+
indent_style = tab
11+
12+
[{CMakeLists.txt,*.cmake}]
13+
indent_style = tab
14+
15+
[*.{yaml,yml}]
16+
indent_style = space
17+
indent_size = 2
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: 'Install Dependencies'
2+
description: 'Install required dependencies in container'
3+
4+
inputs:
5+
clang-tools:
6+
description: 'Install clang & clang-tools-extra'
7+
required: false
8+
default: false
9+
10+
pcap:
11+
description: 'Install libpcap-devel'
12+
required: false
13+
default: false
14+
15+
nfb:
16+
description: 'Install nfb-framework dependencies'
17+
required: false
18+
default: false
19+
20+
dpdk:
21+
description: 'Install DPDK dependencies'
22+
required: false
23+
default: false
24+
25+
nemea:
26+
description: 'Install NEMEA dependencies'
27+
required: false
28+
default: false
29+
30+
tests:
31+
description: 'Install dependencies for tests'
32+
required: false
33+
default: false
34+
35+
runs:
36+
using: 'composite'
37+
steps:
38+
- name: Install build dependencies
39+
shell: bash
40+
run: |
41+
dnf config-manager --set-enabled ol9_codeready_builder
42+
dnf install -y dnf-plugins-core epel-release
43+
dnf install -y make gcc-c++ cmake3 git rpm-build
44+
dnf install -y fuse3-devel openssl-devel gcc-toolset-14-libatomic-devel libunwind-devel lz4-devel
45+
46+
- name: Install clang tools
47+
if: ${{ inputs.clang-tools == 'true' }}
48+
shell: bash
49+
run: |
50+
dnf install -y clang clang-tools-extra
51+
52+
- name: Install libpcap-devel
53+
if: ${{ inputs.pcap == 'true' }}
54+
shell: bash
55+
run: |
56+
dnf install -y libpcap-devel
57+
58+
- name: Install nfb-framework dependencies
59+
if: ${{ inputs.nfb == 'true' }}
60+
shell: bash
61+
run: |
62+
dnf copr enable @CESNET/nfb-framework
63+
dnf install -y nfb-framework numactl-devel
64+
65+
- name: Install DPDK dependencies
66+
if: ${{ inputs.dpdk == 'true' }}
67+
shell: bash
68+
run: |
69+
dnf install -y dpdk-devel
70+
71+
- name: Install NEMEA dependencies
72+
if: ${{ inputs.nemea == 'true' }}
73+
shell: bash
74+
run: |
75+
dnf copr enable @CESNET/NEMEA-stable
76+
dnf install -y nemea-framework-devel
77+
78+
- name: Install dependencies for tests
79+
if: ${{ inputs.tests == 'true' }}
80+
shell: bash
81+
run: |
82+
dnf copr enable @CESNET/NEMEA-stable
83+
dnf install -y nemea-modules

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
container: ${{ inputs.os }}
14+
steps:
15+
- name: Install git
16+
run: dnf install -y git
17+
- name: Check out repository code
18+
uses: actions/checkout@v4
19+
- name: Install dependencies
20+
uses: ./.github/actions/install-dependencies
21+
with:
22+
pcap: true
23+
dpdk: true
24+
nfb: true
25+
- name: Mark github workspace as safe
26+
run: git config --system --add safe.directory $PWD
27+
- name: Create build directory
28+
run: mkdir build
29+
- name: Configure CMake
30+
run: |
31+
cd build
32+
cmake3 .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_INPUT_PCAP=ON -DENABLE_INPUT_DPDK=ON -DENABLE_INPUT_NFB=ON -DENABLE_PROCESS_EXPERIMENTAL=ON
33+
- name: make
34+
run: make

.github/workflows/c-cpp.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: check
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
clang-checks:
7+
runs-on: ubuntu-latest
8+
container: oraclelinux:9
9+
steps:
10+
- name: Check out repository code
11+
uses: actions/checkout@v4
12+
- name: Install dependencies
13+
uses: ./.github/actions/install-dependencies
14+
with:
15+
clang-tools: true
16+
pcap: true
17+
- name: make format-check
18+
run: make format
19+
20+
editor-config:
21+
runs-on: ubuntu-latest
22+
container: mstruebing/editorconfig-checker
23+
steps:
24+
- name: Check out repository code
25+
uses: actions/checkout@v4
26+
- name: Check editorconfig
27+
run: ec --exclude .git --exclude tests/functional/inputs

.github/workflows/ciEntryPoint.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Continuous Integration pipeline
2+
3+
on: push
4+
5+
jobs:
6+
check:
7+
uses: ./.github/workflows/check.yml
8+
build-os-matrix:
9+
needs: check
10+
runs-on: ubuntu-latest
11+
outputs:
12+
os: ${{ steps.os.outputs.os }}
13+
steps:
14+
- name: Build OS Array
15+
id: os
16+
run: |
17+
osArray=()
18+
osArray+=("oraclelinux:9")
19+
osArray=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${osArray[@]}")
20+
echo "Updated os list: $osArray"
21+
echo "os=$osArray" >> $GITHUB_OUTPUT
22+
build:
23+
needs: [build-os-matrix]
24+
strategy:
25+
matrix:
26+
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }}
27+
uses: ./.github/workflows/build.yml
28+
with:
29+
os: ${{ matrix.os }}
30+
31+
make-tests:
32+
needs: [build-os-matrix]
33+
strategy:
34+
matrix:
35+
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }}
36+
uses: ./.github/workflows/tests.yml
37+
with:
38+
os: ${{ matrix.os }}
39+
40+
rpm-build:
41+
needs: [build-os-matrix]
42+
strategy:
43+
matrix:
44+
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }}
45+
uses: ./.github/workflows/rpm-build.yml
46+
with:
47+
os: ${{ matrix.os }}
48+
49+
rpm-install:
50+
needs: [build-os-matrix, rpm-build]
51+
strategy:
52+
matrix:
53+
os: ${{ fromJSON(needs.build-os-matrix.outputs.os) }}
54+
uses: ./.github/workflows/rpm-install.yml
55+
with:
56+
os: ${{ matrix.os }}

0 commit comments

Comments
 (0)