aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-02-02 19:12:07 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-02-28 14:06:33 +0100
commit34bc1a3944458d005752b4e6c000ac35911b6ca6 (patch)
tree98e2fd13e3d61952aa0322634b4180fe23cd5fef /.github
parent34e020ac35a40b9b9440d0064dcd9dcf64fe0cbe (diff)
Added `--enable-code-coverage' build using lcov for coverage generation.add/code-coverage-build
* CI job generates a coverage report Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3a8214849..adcf7fe6b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,6 +10,39 @@ on:
release:
types: [created]
jobs:
+ coverage:
+ name: Coverage (ubuntu-latest)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Install Ubuntu Prerequisites
+ run: |
+ sudo apt-get update
+ sudo apt-get install autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev
+ sudo apt-get install rrdtool librrd-dev
+ sudo apt-get install libgcrypt20-dev libpcre3-dev libmaxminddb-dev lcov
+ - name: Configure
+ run: env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages --enable-code-coverage --with-pcre --with-maxminddb
+ - name: Build
+ run: make all
+ - name: Test
+ run: |
+ ./tests/do.sh
+ ./tests/do-unit.sh
+ ./tests/do-dga.sh
+ - name: Generate Coverage Report
+ run: |
+ mkdir -p coverage_report/ndpi_coverage_report
+ lcov --directory . --capture --output-file lcov.info
+ genhtml -o coverage_report/ndpi_coverage_report lcov.info
+ - uses: actions/upload-artifact@v2
+ with:
+ name: ndpi-coverage-report
+ path: coverage_report
+ retention-days: 7
+
test:
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.gcrypt }} ${{ matrix.compiler }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} ${{ matrix.msan }}
runs-on: ${{ matrix.os }}