{"id":23431135,"url":"https://github.com/imbios/lcov-coverage-badge","last_synced_at":"2025-10-30T13:30:16.871Z","repository":{"id":268209247,"uuid":"903633669","full_name":"ImBIOS/lcov-coverage-badge","owner":"ImBIOS","description":"A GitHub Action for creating markdown embeddable badges, saved to your repository, directly from an LCOV data file.","archived":false,"fork":false,"pushed_at":"2024-12-18T12:45:01.000Z","size":709,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T10:13:47.515Z","etag":null,"topics":["badge","badge-generator","coverage","coverage-report","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImBIOS.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,"publiccode":null,"codemeta":null},"funding":{"github":["ImBIOS"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-12-15T05:53:14.000Z","updated_at":"2025-02-09T20:22:29.000Z","dependencies_parsed_at":"2024-12-15T08:27:17.973Z","dependency_job_id":null,"html_url":"https://github.com/ImBIOS/lcov-coverage-badge","commit_stats":null,"previous_names":["imbios/lcov-coverage-badge"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImBIOS%2Flcov-coverage-badge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImBIOS%2Flcov-coverage-badge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImBIOS%2Flcov-coverage-badge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImBIOS%2Flcov-coverage-badge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImBIOS","download_url":"https://codeload.github.com/ImBIOS/lcov-coverage-badge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968639,"owners_count":19560594,"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":["badge","badge-generator","coverage","coverage-report","hacktoberfest"],"created_at":"2024-12-23T09:53:38.623Z","updated_at":"2025-10-30T13:30:16.450Z","avatar_url":"https://github.com/ImBIOS.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ImBIOS"],"categories":[],"sub_categories":[],"readme":"# LCOV Coverage Badge for GitHub Repositories\n\n## Overview\n\nThis GitHub Action allows you to create and display a **dynamic code coverage badge** in your repository's README.md file, based on LCOV data files generated by **Bazel**. It helps you track your repository's **code health** and **test coverage** with a simple and efficient process.\n\n## Why do you use this action?\n\nFinding a clean solution for generating **coverage badges** from **LCOV data** wasn't easy, so I created this tool to streamline the process for my repositories. This GitHub Action is designed to automatically generate an **LCOV coverage badge** from the **Bazel coverage output** and embed it directly into your project’s README.md or other markdown files.\n\nBy using this action, you'll gain instant insights into your **test coverage percentage** and be able to monitor the **quality of your code** at a glance.\n\nThis project is inspired by **schneegans/dynamic-badges-action** but is tailored specifically to evaluate **LCOV data format**, download badges from **badges.io**, and save them directly to your repository as **coverage.svg**.\n\n## Setup Guide\n\n### Step 1: Update Build File\n\nTo prevent unnecessary builds, ensure you add the following to your build configuration:\n\n```yaml\non:\n  push:\n    branches:\n      - main\n    paths-ignore:\n      - \"**/coverage.svg\"\n  pull_request:\n```\n\n\u003e **Important:** Adding this ignore rule prevents a build loop. Make sure to include this step in your CI/CD pipeline.\n\n### Step 2: Add GitHub Action to Your Workflow\n\nAdd a step in your GitHub Actions workflow to execute the badge creation action. Here's the setup:\n\n```yaml\n...\nsteps:\n  - uses: ImBIOS/lcov-coverage-badge@v1\n    with:\n      file: ./target/coverage.dat\n```\n\n### Step 3: Embed the Badge in Your README.md\n\nOnce the badge is generated and saved as `coverage.svg`, you can add it to your README.md (or other markdown files) using the following syntax:\n\n```markdown\n![coverage](coverage.svg)\n```\n\nExample:\n\n![coverage](coverage.svg)\n\n### Full Configuration Example\n\n```yaml\n...\nsteps:\n- uses: ImBIOS/lcov-coverage-badge@v1\n  with:\n    file: ./target/coverage.dat\n    access_token: ${{ secret.COVERAGE_TOKEN }}\n    style: flat\n    icon_name: googlecloud\n    icon_color: 'ffffff'\n    label: 'Coverage'\n    label_color: 'ffffff'\n    critical: 60\n    criticalColor: '9c2c9c'\n    warning: 75\n    warningColor: 'd68f0c'\n    success_color: '43ad43'\n    message_color: 'ffffff'\n```\n\n## Output Variables\n\nThe GitHub Action provides the following output variables:\n\n- **coverage_functions_found**: Total number of functions found.\n- **coverage_functions_hit**: Total number of functions hit (any \u003e 0).\n- **coverage_lines_found**: Total line count.\n- **coverage_lines_hit**: Total lines hit (any \u003e 0).\n- **coverage_score**: The score calculated as lines hit / lines found.\n- **coverage_badge_url**: The URL used to generate the badge.\n\n## Support Me ⭐\n\nIf you find this project helpful, please consider supporting it by giving it a **star** on GitHub.  \n\nStarring the repository helps others discover it and motivates me to continue improving and maintaining this project.  \n\nYou can star the repository by clicking the \"Star\" button at the top of the GitHub page.\n\nThank you for your support! 😊  \n\n## Benefits of Using LCOV for Coverage Badges\n\n- **Visualize Code Coverage**: Easily track test coverage for your project.\n- **Dynamic Badge Updates**: Automatically update the coverage badge based on your latest tests.\n- **LCOV Compatibility**: Directly integrates with **Bazel** and **LCOV** output files.\n\n## License\n\nThis project is released under the **Apache 2.0** license. For more information, read the [License File](./LICENSE) or visit the official [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).\n\n## Keywords for SEO\n\n- **LCOV coverage badge**\n- **dynamic coverage badge**\n- **GitHub Actions**\n- **Bazel code coverage**\n- **test coverage badge**\n- **CI/CD pipeline**\n- **code health monitoring**\n- **automated test coverage badge**\n- **LCOV data format**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimbios%2Flcov-coverage-badge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimbios%2Flcov-coverage-badge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimbios%2Flcov-coverage-badge/lists"}