Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

schrej/godacov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: Codacy now supports Golang coverage reports directly. This tool is therefore no longer required to submit coverage reports.


godacov FOSSA Status Security Rating

godacov is a command-line tool to publish test coverage reports generated with go test -coverprofile=<filename> to Codacy.

How to use

Install godacov using go get

$ go get github.com/schrej/godacov

Retrieve a project token from codacy from Your Project > Settings > Integrations > Project API.

Run your tests and generate the coverage report.


go test -coverprofile=coverage.out

Finally publish the results to Codacy using


godacov -t <project token> -r ./coverage.out -c <current commit id>

Travis CI

If you are using Travis CI you should add your project token as a secret environment variable, then run the following command in your script. Remember that you have to append -coverprofile=coverage.out to your test command.

godacov -t $CODACY_TOKEN -r ./coverage.out -c $TRAVIS_COMMIT

CLI Usage

Usage:
  godacov [flags]

Flags:
  -i, --allow-insecure    Allow insecure connection to base URL
  -a, --api-base string   The base URL of the codacy API server to use (default "https://api.codacy.com")
  -c, --commit string     The hash of the commit to provide coverage for
  -h, --help              help for godacov
  -r, --report string     coverage report file generated by 'go test'
  -t, --token string      Codacy project token

License

FOSSA Status

About

Command-line tool for publishing go test coverage reports to Codacy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages