/go-test2action

formats go test failures as errors in github action workflows

Primary LanguageGoMIT LicenseMIT

go-test2action

ci

go-test2action is a command line utility that listens for go test output on stdin and writes failures to stdout using GitHub Actions' workflow command syntax. This will annotate code in your pull requests with failures from your go tests.

go-test2action's input needs to be generated by go test -json. It will not work with go tool test2json because test2json doesn't include the test package in its output.

The --passthrough flag causes go-test2action to write the regular test output to stdout in addition to the json it generates.

See script/test in this repository for an example of how to integrate it into your build scripts.