Skip to content

Commit

Permalink
Add check, tests and ubuntu to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rphibel committed Aug 28, 2023
1 parent 0d9a59d commit 0a84509
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 15 deletions.
6 changes: 0 additions & 6 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
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
Expand Down Expand Up @@ -78,10 +77,8 @@ IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
#InsertTrailingCommas: Wrapped
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
Expand All @@ -92,7 +89,6 @@ PointerAlignment: Right
QualifierAlignment: Leave
ReferenceAlignment: Right
ReflowComments: true
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Always
SortIncludes: CaseSensitive
SortUsingDeclarations: true
Expand All @@ -113,8 +109,6 @@ SpaceBeforeParensOptions:
AfterFunctionDefinitionName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: true
AfterRequiresInExpression: true
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
Expand Down
74 changes: 66 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,85 @@ 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', '' ]
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 == ''
run: |
sudo apt-get update
sudo 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: Lint
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build lint
- name: Check style
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build checkstyle
- name: Doc
if: matrix.buildtype == 'release'
run: make -C $GITHUB_WORKSPACE/build doc
- name: Build
run: make -C $GITHUB_WORKSPACE/build
- name: Unit tests
run: make -C $GITHUB_WORKSPACE/build test
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
build/tests/unit/test-report.xml
- name: Coverage
if: matrix.buildtype == 'Debug' && matrix.image == 'fedora:38'
run: |
make -C $GITHUB_WORKSPACE/build coverage
- name: Upload coverage reports 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 }}
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"
)

0 comments on commit 0a84509

Please sign in to comment.