This action let you to run lcov with the needed parameters
Output path for the lcov info, by default coverage.info
Build directory (see lcov man for option -d)
Base directory (see lcov man for option -b)
Path to the gcov binary, by default /usr/bin/gcov
.
It's possible to use /usr/bin/gcov-9
through /usr/bin/gcov-14
.
Comma separated list of simple name-matching patterns to remove from the build, can be empty.
Extra lcov arguments
No outputs.
gcov 13 (version 13.3.0) - default
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov
gcov 9 (version 9.5.0)
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov-9
gcov 10 (version 10.5.0)
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov-10
gcov 11 (version 11.4.0)
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov-11
gcov 12 (version 12.3.0)
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov-12
gcov 14 (version 14.2.0)
uses: danielealbano/[email protected]
with:
gcov_path: /usr/bin/gcov-14
Remove the 3rdparties and benchmarks subfolder (and any path that would contain these two) from the code coverage
uses: danielealbano/[email protected]
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/[email protected]
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