blob: 4714d7798fe4862863d720639f037bf3c9f274f3 [file] [log] [blame]
khenaidoo26721882021-08-11 17:42:52 -04001default: fmt get update test lint
Scott Baker2c1c4822019-10-16 11:02:41 -07002
khenaidoo26721882021-08-11 17:42:52 -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
Scott Baker2c1c4822019-10-16 11:02:41 -07006
khenaidoo26721882021-08-11 17:42:52 -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')
Scott Baker2c1c4822019-10-16 11:02:41 -07009
Scott Baker2c1c4822019-10-16 11:02:41 -070010get:
khenaidoo26721882021-08-11 17:42:52 -040011 $(GO) get ./...
12 $(GO) mod verify
13 $(GO) mod tidy
Scott Baker2c1c4822019-10-16 11:02:41 -070014
khenaidoo26721882021-08-11 17:42:52 -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 ./...