forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Go CI and Makefile targets (valkey-io#1055)
- Loading branch information
1 parent
0e7a866
commit cfc0780
Showing
5 changed files
with
55 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
install-tools: | ||
@cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install % | ||
install-build-tools: | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
|
||
install-dev-tools-go1.18.10: | ||
go install github.com/vakenbolt/[email protected] | ||
go install mvdan.cc/[email protected] | ||
go install github.com/segmentio/[email protected] | ||
go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
install-dev-tools-go1.22.0: | ||
go install github.com/vakenbolt/[email protected] | ||
go install mvdan.cc/[email protected] | ||
go install github.com/segmentio/[email protected] | ||
go install honnef.co/go/tools/cmd/[email protected] | ||
|
||
install-dev-tools: install-dev-tools-go1.22.0 | ||
|
||
install-tools-go1.18.10: install-build-tools install-dev-tools-go1.18.10 | ||
|
||
install-tools-go1.22.0: install-build-tools install-dev-tools-go1.22.0 | ||
|
||
install-tools: install-tools-go1.22.0 | ||
|
||
build: build-glide-core build-glide-client generate-protobuf | ||
go build ./... | ||
|
@@ -23,7 +43,22 @@ generate-protobuf: | |
lint: | ||
go vet ./... | ||
staticcheck ./... | ||
gofumpt -d . | ||
golines --dry-run --shorten-comments -m 127 . | ||
|
||
lint-ci: | ||
go vet ./... | ||
staticcheck ./... | ||
if [ "$$(gofumpt -l . | wc -l)" -gt 0 ]; then exit 1; fi | ||
if [ "$$(golines -l --shorten-comments -m 127 . | wc -l)" -gt 0 ]; then exit 1; fi | ||
|
||
format: | ||
gofumpt -w . | ||
golines -w --shorten-comments -m 127 . | ||
|
||
test: | ||
go test -v -race `go list ./... | grep -v protobuf` | ||
|
||
unit-test-report: | ||
test-and-report: | ||
mkdir -p reports | ||
go test -race ./... -json | go-test-report -o reports/unit-test-report.html | ||
go test -v -race `go list ./... | grep -v protobuf` -json | go-test-report -o reports/test-report.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.