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 Sep 5, 2023
1 parent 0d9a59d commit fe852fd
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 16 deletions.
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
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: |
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: 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 }}
- 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"
)

0 comments on commit fe852fd

Please sign in to comment.