Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI workflow #9

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ BraceWrapping:
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Always
rphibel marked this conversation as resolved.
Show resolved Hide resolved
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
Expand Down Expand Up @@ -78,11 +77,8 @@ IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
#InsertTrailingCommas: Wrapped
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MaxEmptyLinesToKeep: 1
Expand All @@ -92,7 +88,6 @@ PointerAlignment: Right
QualifierAlignment: Leave
ReferenceAlignment: Right
ReflowComments: true
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Always
SortIncludes: CaseSensitive
SortUsingDeclarations: true
Expand All @@ -113,8 +108,6 @@ SpaceBeforeParensOptions:
AfterFunctionDefinitionName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: true
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
Expand Down
63 changes: 55 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,74 @@ on:
branches:
- main

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-22.04
container: fedora:38
strategy:
fail-fast: false
matrix:
buildtype:
- debug
- release
buildtype: [ 'debug', 'release' ]
image: [ 'fedora:38', 'ubuntu:22.04' ]
container: ${{ matrix.image }}
steps:
- name: Install packages
- name: Install packages Fedora
if: matrix.image == 'fedora:38'
run: |
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable naccyde/criterion
sudo dnf -y install cmake libbpf-devel \
criterion-devel clang-tools-extra lcov libasan libubsan \
doxygen python3-sphinx python3-breathe python3-furo
sudo dnf -y install \
clang-tools-extra \
cmake \
criterion-devel \
doxygen \
lcov \
libasan \
libbpf-devel \
libubsan \
python3-breathe \
python3-furo \
python3-sphinx
- name: Install packages Ubuntu
if: matrix.image == 'ubuntu:22.04'
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install \
clang-format \
clang-tidy \
cmake \
doxygen \
lcov \
libbpf-dev \
libcriterion-dev \
python3-breathe \
python3-pip \
python3-sphinx
pip install furo
- name: Check out repository code
uses: actions/checkout@v3
- name: Configure build
run: cmake -B $GITHUB_WORKSPACE/build -S $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }}
- name: Build
run: make -C $GITHUB_WORKSPACE/build
- name: Check style
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build checkstyle
- name: Run unit tests
run: make -C $GITHUB_WORKSPACE/build test
- name: Coverage
if: matrix.buildtype == 'Debug' && matrix.image == 'fedora:38'
run: make -C $GITHUB_WORKSPACE/build coverage
- name: Upload coverage report to Codecov
if: matrix.buildtype == 'Debug' && matrix.image == 'fedora:38'
uses: codecov/codecov-action@v3
with:
files: build/doc/lcov.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
rphibel marked this conversation as resolved.
Show resolved Hide resolved
- name: Generate documentation
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build doc
2 changes: 1 addition & 1 deletion tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ target_link_options(tests_unit
)

add_custom_target(test
COMMAND $<TARGET_FILE:tests_unit> --verbose
COMMAND $<TARGET_FILE:tests_unit> --verbose --xml=test-report.xml
DEPENDS tests_unit
COMMENT "Running unit tests"
)