-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
35 lines (28 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
GO_VERBOSE := -v
CS_BUILD_DIR := $(PWD)/build/container-suseconnect
PROJECT := github.com/SUSE/container-suseconnect
export GO111MODULE=auto
ifneq "$(VERBOSE)" "1"
GO_VERBOSE=
.SILENT:
endif
all:
rm -rf $(CS_BUILD_DIR)
mkdir -p $(CS_BUILD_DIR)
GOBIN=$(CS_BUILD_DIR) go install -ldflags='-w -s' -a $(GO_VERBOSE) ./...
.PHONY: test
test: test-unit validate-go
.PHONY: test-unit
test-unit:
go test $(GO_VERBOSE) ./...
.PHONY: validate-go
validate-go:
build/ci/climate -t 80 -o internal
build/ci/climate -t 80 -o internal/regionsrv
go mod verify
@which gofmt >/dev/null 2>/dev/null || (echo "ERROR: gofmt not found." && false)
test -z "$$(gofmt -s -l . | tee /dev/stderr)"
@which staticcheck >/dev/null 2>/dev/null || echo "WARNING: staticcheck not found." || true
@which "staticcheck" >/dev/null 2>/dev/null && "$$(staticcheck -tests=false 2>&1 | tee /dev/stderr)" || true
@go doc cmd/vet >/dev/null 2>/dev/null || (echo "ERROR: go vet not found." && false)
test -z "$$(go vet $$(go list $(PROJECT)/... ) 2>&1 | tee /dev/stderr)"