-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (29 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
GOLANGCI_VERSION = 1.32.0
ci: clean lint test
.PHONY: ci
LDFLAGS := -ldflags="-s -w"
bin/golangci-lint: bin/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} bin/golangci-lint
bin/golangci-lint-${GOLANGCI_VERSION}:
@curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=golangci-lint bash -s -- v${GOLANGCI_VERSION}
@mv bin/golangci-lint $@
bin/go-acc:
@env GOBIN=$$PWD/bin GO111MODULE=on go install github.com/ory/go-acc
bin/mockgen:
@env GOBIN=$$PWD/bin GO111MODULE=on go install github.com/golang/mock/mockgen
mocks: bin/mockgen
@echo "--- build all the mocks"
@bin/mockgen -destination=mocks/s3.go -package=mocks github.com/aws/aws-sdk-go/service/s3/s3iface S3API
.PHONY: mocks
clean:
@echo "--- clean all the things"
@rm -rf dist
.PHONY: clean
lint: bin/golangci-lint
@echo "--- lint all the things"
@bin/golangci-lint run
.PHONY: lint
test: bin/go-acc
@echo "--- test all the things"
@bin/go-acc --ignore mocks ./... -- -short -v -failfast
.PHONY: test