Skip to content

Commit

Permalink
ci: set up coverage on GHA
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Jun 27, 2022
1 parent c781998 commit 34f0e61
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 92 deletions.
25 changes: 0 additions & 25 deletions .ci/build_doxygen.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .ci/build_lcov.sh

This file was deleted.

23 changes: 0 additions & 23 deletions .ci/make_and_test.sh

This file was deleted.

27 changes: 0 additions & 27 deletions .ci/run_codecov.sh

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,44 @@ on:
pull_request:

jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
matrix:
std: ["11", "14", "17", "20"]
steps:
- uses: actions/checkout@v3

- name: Get LCov
run: |
wget https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz
tar -xzf cov-1.16.tar.gz
cd lcov-1.16
make install
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCLI11_SINGLE_FILE_TESTS=OFF \
-DCLI11_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Coverage
- name: Build
run: cmake --build build -j4

- name: Test
run: cmake --build build --target CLI11_coverage

- name: Upload coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '*/tests/*' '*/examples/*' '*gtest*' '*gmock*' '/usr/*' --output-file coverage.info
lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
working-directory: build

clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-latest
Expand Down

0 comments on commit 34f0e61

Please sign in to comment.