https://github.com/gotesttools/limgo-badge-action
GitHub Action for limgo to generate badges showing the test coverage
https://github.com/gotesttools/limgo-badge-action
badge-generator github-actions go golang test-coverage testing
Last synced: 5 months ago
JSON representation
GitHub Action for limgo to generate badges showing the test coverage
- Host: GitHub
- URL: https://github.com/gotesttools/limgo-badge-action
- Owner: GoTestTools
- Created: 2022-11-23T10:52:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-14T09:24:30.000Z (about 3 years ago)
- Last Synced: 2025-06-15T14:47:28.023Z (8 months ago)
- Topics: badge-generator, github-actions, go, golang, test-coverage, testing
- Language: TypeScript
- Homepage:
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
limgo-badge-action
Show your test coverage
---
This action uses the coverage output from [limgo](https://github.com/GoTestTools/limgo) to generate a badge visualizing the achieved test coverage. It also pushes the badge to the specified `repository/branch` so that it can be integrated into any README via:
```html
```
The following sample badge is imported from the [GoTestTools/limgo](https://github.com/GoTestTools/limgo) repository:
## Usage
You can use `limgo-badge-action` with the following configuration:
```yaml
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
# Checkout your project with git
- name: Checkout
uses: actions/checkout@v2
# Install Go on the VM running the action.
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
# Run your tests with -coverprofile
- name: Run tests
run: |
go test ./... -coverprofile=test.cov
# Run the test coverage check using the limgo-action and output the statistic file
- name: Run test coverage check
uses: GoTestTools/limgo-action@v1.0.0
with:
version: "v0.0.0-beta"
args: "-coverfile=test.cov -outfile=covcheck.tmp -config=.limgo.json -v=3"
# Generate the badge only for commits on the main branch
- name: Generate test badge
if: github.ref == 'refs/heads/main'
uses: GoTestTools/limgo-badge-action@v1.0.0
with:
# name of the limgo test coverage file
limgo_file: covcheck.tmp
# format of the limgo test coverage file
limgo_file_format: tab
# name of the badge
badge_name: limgo-badge.png
# repository where the generated badge is pushed to
repo: github.com/GoTestTools/limgo
# branch of the repository where the generated badge is pushed to (will be created if it doesn't exist)
branch: limgo-badge
# github token which is required to create and push to the repository
github_token: ${{ secrets.GH_TOKEN }}
# github user who owns the github_token
github_token_owner: engelmi
# flag to show the branch coverage in the generated badge
badge_enabled_branch: false
# flag to show the statement coverage in the generated badge
badge_enabled_stmt: false
# flag to show the line coverage in the generated badge
badge_enabled_lines: true
```
For more information about `limgo` please see the [limgo](https://github.com/GoTestTools/limgo) repository.
For more information about `limgo-action` please see the [limgo-action](https://github.com/GoTestTools/limgo-action) repository.