| 1 |
ifeq "$(strip $(shell go env GOARCH))" "amd64" |
| 2 |
RACE_FLAG := -race |
| 3 |
endif |
| 4 |
|
| 5 |
.PHONY: test |
| 6 |
test: pretest gotest |
| 7 |
|
| 8 |
.PHONY: golangci-lint |
| 9 |
golangci-lint: |
| 10 |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
| 11 |
golangci-lint run |
| 12 |
|
| 13 |
.PHONY: staticcheck |
| 14 |
staticcheck: |
| 15 |
go install honnef.co/go/tools/cmd/staticcheck@master |
| 16 |
staticcheck ./... |
| 17 |
|
| 18 |
.PHONY: lint |
| 19 |
lint: golangci-lint staticcheck |
| 20 |
|
| 21 |
.PHONY: pretest |
| 22 |
pretest: lint |
| 23 |
|
| 24 |
.PHONY: gotest |
| 25 |
gotest: |
| 26 |
go test $(RACE_FLAG) -vet all ./... |
| 27 |
|
| 28 |
.PHONY: integration |
| 29 |
integration: |
| 30 |
go test -tags docker_integration -run TestIntegration -v |