This PR introduces several key improvements to the CI workflow, focusing on better formatting checks, dependency management, and enhanced test result visibility.
Changes:
Code Formatting Enforcement (make pretty):
Added a make pretty step to the CI workflow that runs gofumpt and goimports-reviser to ensure Go code is consistently formatted.
The CI now fails if code is not properly formatted, ensuring all commits maintain a consistent style.
Go Module Tidy Check:
Integrated a go mod tidy check to ensure go.mod and go.sum files are up to date and clean.
CI will fail if go mod tidy results in any changes, prompting developers to keep dependencies tidy before merging.
Improved Test Reporting:
Replaced the basic make test step with a detailed test run using go test -v, which outputs detailed logs for debugging.
Added the dorny/test-reporter GitHub Action to annotate test failures directly in the GitHub UI using the JUnit format, making it easier to view and track failed tests without manually parsing logs.
Linting:
Added make lint and a linter configuration.
Pre-commit Git Hook:
Adds a git pre-commit hook when you run make install-hooks.
Description
This PR introduces several key improvements to the CI workflow, focusing on better formatting checks, dependency management, and enhanced test result visibility.
Changes:
Code Formatting Enforcement (
make pretty
):make pretty
step to the CI workflow that runsgofumpt
andgoimports-reviser
to ensure Go code is consistently formatted.Go Module Tidy Check:
go mod tidy
check to ensurego.mod
andgo.sum
files are up to date and clean.go mod tidy
results in any changes, prompting developers to keep dependencies tidy before merging.Improved Test Reporting:
make test
step with a detailed test run usinggo test -v
, which outputs detailed logs for debugging.dorny/test-reporter
GitHub Action to annotate test failures directly in the GitHub UI using the JUnit format, making it easier to view and track failed tests without manually parsing logs.Linting:
make lint
and a linter configuration.Pre-commit Git Hook:
make install-hooks
.