Skip to content

A Github action which will generate a go code coverage report and coverage badge and add them to your wiki

Notifications You must be signed in to change notification settings

crowdriff/go-coverage-gha

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Go coverage report

A GitHub Action to add a coverage report and badge to your Go repo.

Apply it to your repo by adding this step to one of your workflows:

- name: Update coverage report
  uses: crowdriff/go-coverage-gha@v0

Your repo needs to have a Wiki for the action to work, and workflows need to have read and write permissions to the repo.

Complete example:

- name: Test
  run: go test -v ./...

- name: Update coverage report
  uses: crowdriff/go-coverage-gha@v0
  if: |
    matrix.os == 'ubuntu-latest' &&
    github.event_name == 'push'  
  continue-on-error: true

The action generates an HTML report and SVG badge, and saves them as “hidden” files in your Wiki.

To add a coverage badge to your README.md, use this Markdown snippet:

[![Go Coverage](https://github.com/USER/REPO/wiki/coverage.svg)](https://raw.githack.com/wiki/USER/REPO/coverage.html)

Clicking on the badge opens the coverage report.

The action will also log to the Wiki the unix timestamp and coverage of every run,

Use manually or as a pre-commit hook

The script can also be run manually, or as a pre-commit hook.

Credits

About

A Github action which will generate a go code coverage report and coverage badge and add them to your wiki

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages