From f724632f10b3c27c4704d8f6ccc56c4f2ede2df7 Mon Sep 17 00:00:00 2001 From: alvin1221 Date: Fri, 9 Dec 2022 15:32:08 +0800 Subject: [PATCH] * NEW [workflow] add coverage.yml --- .codecov.yml | 2 ++ .github/workflows/coverage.yml | 35 ++++++++++++++++++++++++++++++++++ .grcov.yml | 5 +++++ 3 files changed, 42 insertions(+) create mode 100644 .codecov.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .grcov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..c7aeb567 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +coverage: + range: 50..95 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..1ad92515 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,35 @@ +name: coverage +on: [push] +jobs: + + linux-coverage: + name: linux + runs-on: [ ubuntu-latest ] + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install mbedTLS + run: sudo apt-get install libmbedtls-dev + + - name: Install ninja + run: sudo apt-get install ninja-build + + - name: Configure + run: mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DNNG_ENABLE_COVERAGE=ON -DNNG_ENABLE_TLS=ON -DNNG_ENABLE_SQLITE=ON .. + + - name: build + run: cd build && ninja && sudo ninja install + + - name: Test + run: | + python3 .github/scripts/test.py + # run: cd build && ctest --output-on-failure + + - name: Upload report + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + yml: ./.codecov.yml diff --git a/.grcov.yml b/.grcov.yml new file mode 100644 index 00000000..781860c7 --- /dev/null +++ b/.grcov.yml @@ -0,0 +1,5 @@ +branch: true +ignore-not-existing: true +filter: covered +output-type: lcov +output-file: lcov.info \ No newline at end of file