blob: 4714d7798fe4862863d720639f037bf3c9f274f3 [file] [log] [blame]
khenaidoo106c61a2021-08-11 18:05:46 -04001default: fmt get update test lint
William Kurkianea869482019-04-09 15:16:11 -04002
khenaidoo106c61a2021-08-11 18:05:46 -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
William Kurkianea869482019-04-09 15:16:11 -04006
khenaidoo106c61a2021-08-11 18:05:46 -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')
William Kurkianea869482019-04-09 15:16:11 -04009
William Kurkianea869482019-04-09 15:16:11 -040010get:
khenaidoo106c61a2021-08-11 18:05:46 -040011 $(GO) get ./...
12 $(GO) mod verify
13 $(GO) mod tidy
Abhilash S.L3b494632019-07-16 15:51:09 +053014
khenaidoo106c61a2021-08-11 18:05:46 -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 ./...