You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Gcovr Action
v0.1.0
Generate code coverage report for C++ project on GitHub Actions using gcovr.
For more information, see action.yml and the GitHub Actions guide.
Note: All inputs are optional.
Name | Value Type | Description |
---|---|---|
root |
Path | The root directory of your source files. Defaults to current directory. File names are reported relative to this root. |
gcov-executable |
Executable name with optional arguments | Use a particular gcov executable. Must match the compiler you are using, e.g. llvm-cov gcov for LLVM. See this. |
exclude |
Regular expression | Exclude source files that match this filter. |
fail-under-line |
0 - 100 | Fail if the total line coverage is less than this value. |
coveralls-out |
Path | Output file of generated Coveralls API coverage report. |
coveralls-send |
true or false |
Send Coveralls API coverage report to it's endpoint (default: false ). |
coveralls-repo-token |
Token | Coveralls repo token, required for sending Coveralls API coverage report successfully. See this. |
name: test
on:
push:
jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.2.0
- name: Build and test project
run: |
cmake . -B build
cmake --build build
ctest --test-dir build
- name: Generate code coverage report
uses: threeal/gcovr-action@latest
- name: Build and test project
run: |
cmake . -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build
ctest --test-dir build
- name: Generate code coverage report
uses: threeal/gcovr-action@latest
with:
gcov-executable: llvm-cov gcov
- name: Generate and send code coverage report to Coveralls
uses: threeal/gcovr-action@latest
with:
coveralls-send: true
coveralls-repo-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
This project is maintained by Alfi Maulana and licensed under the MIT License.