godacov

command module
v0.0.0-...-5a51281 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL