This action let you to run lcov with the needed parameters
Required Path to the gcov binary, by default /usr/bin/gcov
.
It's possible to use /usr/bin/gcov-7
and /usr/bin/gcov-8
.
Required Comma separated list of simple name-matching patterns to remove from the build, can be empty.
Required Output path for the lcov info, by default coverage.info
Required Build directory (see lcov man for option -d)
Required Base directory (see lcov man for option -b)
No outputs.
gcov 7 (version 7.5.0)
uses: danielealbano/lcov-action@v3
with:
gcov_tool: /usr/bin/gcov-7
gcov 8 (version 8.4.0)
uses: danielealbano/lcov-action@v3
with:
gcov_tool: /usr/bin/gcov-8
gcov 9 (version 9.3.0) - default
uses: danielealbano/lcov-action@v3
Remove the 3rdparties and benchmarks subfolder (and any path that would contain these two) from the code coverage
uses: danielealbano/lcov-action@v3
with:
remove_patterns: 3rdparties,benchmarks
The lcov-action can be leverage to easily integrated codecov and their action into any CI pipeline.
When running lcov-action with the default working directory and coverage output file, the coverage.info
will be created in ${{github.workspace}}
, so the only step required is to pass the full path to the codecov action using files: ${{github.workspace}}/coverage.info
.
Here an example taken from cachegrand main CI workflow ( https://github.com/danielealbano/cachegrand/blob/main/.github/workflows/build_and_test.yml )
- name: Tests - Unit Tests
working-directory: ${{github.workspace}}/build
shell: bash
run: cd tests/unit_tests && sudo ./cachegrand-tests --order lex
- name: Code Coverage - Generation
uses: danielealbano/lcov-action@v3
with:
gcov_path: /usr/bin/gcov-9
remove_patterns: 3rdparty,tests
- uses: codecov/codecov-action@v3
with:
files: ${{github.workspace}}/coverage.info
flags: unittests # optional
name: cachegrand-server
fail_ci_if_error: false
verbose: false
Copyright (C) 2020-2021 Daniele Salvatore Albano
BSD 2-Clause License