blob: 4714d7798fe4862863d720639f037bf3c9f274f3 [file] [log] [blame]
khenaidoo7d3c5582021-08-11 18:09:44 -04001default: fmt get update test lint
Holger Hildebrandtfa074992020-03-27 15:42:06 +00002
khenaidoo7d3c5582021-08-11 18:09:44 -04003GO := go
4GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
5GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race -timeout 6m -coverprofile=profile.out -covermode=atomic
Holger Hildebrandtfa074992020-03-27 15:42:06 +00006
khenaidoo7d3c5582021-08-11 18:09:44 -04007FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
8TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go')
Holger Hildebrandtfa074992020-03-27 15:42:06 +00009
Holger Hildebrandtfa074992020-03-27 15:42:06 +000010get:
khenaidoo7d3c5582021-08-11 18:09:44 -040011 $(GO) get ./...
12 $(GO) mod verify
13 $(GO) mod tidy
Holger Hildebrandtfa074992020-03-27 15:42:06 +000014
khenaidoo7d3c5582021-08-11 18:09:44 -040015update:
16 $(GO) get -u -v ./...
17 $(GO) mod verify
18 $(GO) mod tidy
19
20fmt:
21 gofmt -s -l -w $(FILES) $(TESTS)
22
23lint:
24 GOFLAGS="-tags=functional" golangci-lint run
25
26test:
27 $(GOTEST) ./...
28
29.PHONY: test_functional
30test_functional:
31 $(GOTEST) -tags=functional ./...