mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-03-08 16:39:29 +00:00
Several packages are only used while running the e2e suite. These packages are less important to update, as the they can not influence the final executable that is part of the Ceph-CSI container-image. By moving these dependencies out of the main Ceph-CSI go.mod, it is easier to identify if a reported CVE affects Ceph-CSI, or only the testing (like most of the Kubernetes CVEs). Signed-off-by: Niels de Vos <ndevos@ibm.com>
39 lines
874 B
Makefile
39 lines
874 B
Makefile
# Directory to put `go install`ed binaries in.
|
|
export GOBIN ?= $(shell pwd)/bin
|
|
|
|
GO_FILES := $(shell \
|
|
find . '(' -path '*/.*' -o -path './vendor' ')' -prune \
|
|
-o -name '*.go' -print | cut -b3-)
|
|
|
|
.PHONY: build
|
|
build:
|
|
go build ./...
|
|
|
|
.PHONY: test
|
|
test:
|
|
go test -race ./...
|
|
|
|
.PHONY: gofmt
|
|
gofmt:
|
|
$(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX))
|
|
@gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true
|
|
@[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false)
|
|
|
|
.PHONY: golint
|
|
golint:
|
|
@cd tools && go install golang.org/x/lint/golint
|
|
@$(GOBIN)/golint ./...
|
|
|
|
.PHONY: staticcheck
|
|
staticcheck:
|
|
@cd tools && go install honnef.co/go/tools/cmd/staticcheck
|
|
@$(GOBIN)/staticcheck ./...
|
|
|
|
.PHONY: lint
|
|
lint: gofmt golint staticcheck
|
|
|
|
.PHONY: cover
|
|
cover:
|
|
go test -race -coverprofile=cover.out -coverpkg=./... -v ./...
|
|
go tool cover -html=cover.out -o cover.html
|