jasonmiller-cc/Go Unit Testing

Run Go unit tests with race-condition detection, generate code-coverage reports (HTML + text), enforce a minimum-coverage threshold, and upload all artifacts for later inspection.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
go-versionThe Go toolchain version to use (e.g. "stable", "1.22", "^1.21"). Passed directly to actions/setup-go. nostable
working-directoryPath (relative to the repository root) that contains the Go module you want to test. Defaults to the repository root. no.
test-flagsExtra flags forwarded verbatim to `go test`. Example: "-count=1 -timeout 120s" no""
coverage-thresholdMinimum acceptable total code-coverage percentage (0–100). The step fails when actual coverage falls below this value. no0
upload-artifactsSet to "true" to upload coverage reports and raw test output as a workflow artifact; "false" to skip the upload step. notrue
artifact-nameName given to the uploaded artifact bundle. Must be unique within a single workflow run when the action is invoked multiple times. nogo-test-artifacts
artifact-retention-daysNumber of days GitHub retains the uploaded artifact (1–90). no30
run-vetSet to "true" to run `go vet ./...` before executing tests. Catches common correctness issues early. notrue
namedescription
coverage-percentageTotal code-coverage percentage reported by `go tool cover`.
test-result"pass" when all tests succeed; "fail" otherwise.