blob: 4714d7798fe4862863d720639f037bf3c9f274f3 [file] [log] [blame]
David K. Bainbridgebd6b2882021-08-26 13:31:02 +00001default: fmt get update test lint
Scott Bakered4efab2020-01-13 19:12:25 -08002
David K. Bainbridgebd6b2882021-08-26 13:31:02 +00003GO := 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 Bakered4efab2020-01-13 19:12:25 -08006
David K. Bainbridgebd6b2882021-08-26 13:31:02 +00007FILES := $(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 Bakered4efab2020-01-13 19:12:25 -08009
Scott Bakered4efab2020-01-13 19:12:25 -080010get:
David K. Bainbridgebd6b2882021-08-26 13:31:02 +000011 $(GO) get ./...
12 $(GO) mod verify
13 $(GO) mod tidy
Scott Bakered4efab2020-01-13 19:12:25 -080014
David K. Bainbridgebd6b2882021-08-26 13:31:02 +000015update:
16 $(GO) get -u -v ./...
17 $(GO) mod verify
18 $(GO) mod tidy
Scott Bakered4efab2020-01-13 19:12:25 -080019
David K. Bainbridgebd6b2882021-08-26 13:31:02 +000020fmt:
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 ./...