{"id":16962530,"url":"https://github.com/threeal/gcovr-action","last_synced_at":"2025-04-11T21:31:07.545Z","repository":{"id":65162043,"uuid":"583559388","full_name":"threeal/gcovr-action","owner":"threeal","description":"Generate code coverage reports for a C++ project on GitHub Actions using gcovr","archived":false,"fork":false,"pushed_at":"2024-04-14T09:17:31.000Z","size":19600,"stargazers_count":10,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T12:32:54.284Z","etag":null,"topics":["actions","c","ci","code-quality","coverage","coverage-report","cpp","gcc","gcov","test-coverage","testing"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/gcovr-action","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threeal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-12-30T06:27:00.000Z","updated_at":"2024-04-15T15:08:08.321Z","dependencies_parsed_at":"2024-01-12T09:45:47.762Z","dependency_job_id":"f83378e5-f105-4c0a-8fe2-fb129788f593","html_url":"https://github.com/threeal/gcovr-action","commit_stats":{"total_commits":324,"total_committers":2,"mean_commits":162.0,"dds":0.06172839506172845,"last_synced_commit":"6d9360989ff3b3876c7f5f8c197dd9ce6e7ba7ce"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgcovr-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgcovr-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgcovr-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgcovr-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threeal","download_url":"https://codeload.github.com/threeal/gcovr-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248482910,"owners_count":21111400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","c","ci","code-quality","coverage","coverage-report","cpp","gcc","gcov","test-coverage","testing"],"created_at":"2024-10-13T23:07:02.538Z","updated_at":"2025-04-11T21:31:07.532Z","avatar_url":"https://github.com/threeal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gcovr Action\n\nCheck test coverage and generate reports for C/C++ projects using [gcovr](https://gcovr.com/en/stable/) on [GitHub Actions](https://github.com/features/actions).\n\n## Key Features\n\n- Check test coverage for C/C++ projects compiled with [GCC](https://gcc.gnu.org/) and [LLVM Clang](https://clang.llvm.org/).\n- Generate test coverage reports in HTML, [Cobertura](https://cobertura.github.io/cobertura/), and [Coveralls](https://coveralls.io/) formats.\n- Support file exclusion and fail if coverage is below a specific threshold.\n- Support sending reports directly to Coveralls.\n- Automatically install and cache the gcovr program on GitHub Actions.\n\n## Available Inputs\n\nThe following table lists all available inputs supported by this action. Please note that these inputs are optional.\n\n| Name | Value Type | Description |\n| --- | --- | --- |\n| `root` | Path | Root directory of your source files. Defaults to the current directory. File names are reported relative to this directory. |\n| `gcov-executable` | Executable name with optional arguments | Use a specific [gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html) executable. It must match the compiler you are using, e.g., `llvm-cov gcov` for LLVM Clang. |\n| `excludes` | One or more regular expression patterns | Exclude source files that match these filters. |\n| `filter` | One or more regular expression patterns | Filter source files that match these filters. |\n| `fail-under-line` | 0 - 100 | Fail if the total line coverage is less than this value. |\n| `fail-under-branch` | 0 - 100 | Fail if the total branch coverage is less than this value. |\n| `fail-under-function` | 0 - 100 | Fail if the total function coverage is less than this value. |\n| `fail-under-decision` | 0 - 100 | Fail if the total decision coverage is less than this value. |\n| `html-out` | Path | Output file for the generated HTML report. |\n| `html-details` | `true` or `false` | Enable to add annotated source code reports to the HTML report. Defaults to `false`. |\n| `html-theme` | String | Override the default color theme for the HTML report. |\n| `html-title` | String | Override the default title for the HTML report. |\n| `xml-out` | Path | Output file for the generated Cobertura report. |\n| `coveralls-out` | Path | Output file for the generated Coveralls report. |\n| `coveralls-send` | `true` or `false` | Send the generated Coveralls report to its endpoint. Defaults to `false`. |\n| `decisions` | `true` or `false` | Report the decision coverage in HTML, JSON, and summary reports. Defaults to `false`. |\n| `calls` | `true` or `false` | Report the calls coverage in HTML and summary reports. Defaults to `false`. |\n| `jobs` | `true`, `false`, or number | Set the number of threads to use in parallel. When set to `true` without a number, uses all available processors. Defaults to `false`. |\n| `print-summary` | `true` or `false` | Print a small report to stdout showing line, function, branch percentage coverage with optional decision \u0026 call coverage. This is in addition to other reports. Defaults to `false`. |\n| `github-token` | Token | [GitHub token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) for your project. Defaults to [`github.token`](https://docs.github.com/en/actions/security-guides/automatic-token-authentication). Required for successfully sending the Coveralls report to its endpoint. |\n| `working-directory` | Path | The working directory where gcovr should be executed. |\n| `cobertura-out` | Path | Generate a Cobertura XML report. |\n| `cobertura-pretty` | `true` or `false` | Pretty-print the Cobertura XML report. Defaults to `false`. |\n| `jacoco-out` | Path | Output file for the generated JaCoCo report. |\n| `json-out` | Path | Generate a JSON report. |\n| `json-pretty` | `true` or `false` | Pretty-print the JSON report. Defaults to `false`. |\n| `json-summary-out` | Path | Generate a JSON summary report. |\n| `json-summary-pretty` | `true` or `false` | Pretty-print the JSON SUMMARY report. Defaults to `false`. |\n| `lcov-out` | Path | Generate LCOV coverage report. |\n| `sonarqube-out` | Path | Generate sonarqube generic coverage report. |\n| `txt-out` | Path | Output file for the generated text report. |\n\n## Example Usages\n\nThis example demonstrates how to use this action to check test coverage of a C/C++ project on GitHub Actions. By default, if no other inputs are given, this action will print the test coverage report to the log.\n\n```yaml\nname: test\non:\n  push:\njobs:\n  test-project:\n    runs-on: ubuntu-24.04\n    steps:\n      - name: Checkout Project\n        uses: actions/checkout@v4.2.2\n\n      - name: Build Project\n        uses: threeal/cmake-action@v2.0.0\n\n      - name: Test Project\n        uses: threeal/ctest-action@v1.1.0\n\n      - name: Check Test Coverage\n        uses: threeal/gcovr-action@v1.1.0\n```\n\n### Specify Test Coverage Threshold\n\nTo specify the minimum required test coverage threshold, set the `fail-under-line`, `fail-under-branch`, and/or `fail-under-function` inputs with a number ranging from 0-100 indicating the percentage of the threshold. For example, the following will check and assert if the test line coverage is above 80%:\n\n```yaml\n- name: Check Test Coverage\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    fail-under-line: 80\n```\n\n### Generate HTML Report\n\nSpecify the `html-out` input to generate the test coverage report in HTML format:\n\n```yaml\n- name: Generate HTML Report\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    html-out: coverage.html\n```\n\nOther options are also available to customize the generated HTML output:\n\n```yaml\n- name: Generate HTML Report\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    html-out: coverage.html\n    html-details: true\n    html-title: My Project Test Coverage Report\n    html-theme: github.green\n```\n\n### Generate Cobertura Report\n\nSpecify the `xml-out` input to generate the test coverage report in Cobertura format:\n\n```yaml\n- name: Generate Cobertura Report\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    xml-out: cobertura.xml\n```\n\n### Generate Coveralls Report\n\nSpecify the `coveralls-out` input to generate the test coverage report in Coveralls format:\n\n```yaml\n- name: Generate Coveralls Report\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    coveralls-out: coveralls.json\n```\n\nRather than outputting the report as a file, it can also be directly sent to Coveralls by setting the `coveralls-send` input to `true`:\n\n```yaml\n- name: Send Coveralls Report\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    coveralls-send: true\n```\n\n### Using LLVM Clang\n\nBy default, gcovr works well with projects compiled using GCC. However, for projects compiled using LLVM Clang, the `gcov-executable` input must correctly specify the `gcov` program that works with that compiler. See [this](https://gcovr.com/en/stable/guide/compiling.html#choosing-the-right-gcov-executable) for more details.\n\n```yaml\n- name: Check Test Coverage\n  uses: threeal/gcovr-action@v1.1.0\n  with:\n    gcov-executable: llvm-cov gcov\n```\n\n## License\n\nThis project is licensed under the terms of the [MIT License](./LICENSE).\n\nCopyright © 2022-2025 [Alfi Maulana](https://github.com/threeal/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fgcovr-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeal%2Fgcovr-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fgcovr-action/lists"}