-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (37 loc) · 1.31 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
39
40
41
42
43
44
45
46
47
48
49
50
SHELL=/bin/bash
run-all-tests: run-linter run-unit-tests
pre-commit: vendor-deps run-all-tests
run-unit-tests:
@go clean -testcache && go test -v -race ./...
run-unit-tests-cover:
@go test ./... -race -v -coverprofile cover.out && \
go tool cover -html=cover.out -o cover.html && \
open file:///$(shell pwd)/cover.html
run-linter:
@golangci-lint run --deadline=480s --skip-dirs=vendor --tests
install-linter:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.35.2
go-doc-mac:
@open http://localhost:6060 && \
godoc -http=:6060
go-doc-linux:
@xdg-open http://localhost:6060 && \
godoc -http=:6060
vendor-deps:
@go mod tidy && go mod vendor
release-test: ## test release
@goreleaser --skip-publish --rm-dist --snapshot
tag: ## Generate a new tag and push (tag version=0.0.0)
@test $(version)
@git tag -a v$(version) -m "Pending full release..."
@git push origin v$(version)
@git fetch --tags -f
tag-remove: ## Remove a tag if found (tag-remove version=0.0.0)
@test $(version)
@git tag -d v$(version)
@git push --delete origin v$(version)
@git fetch --tags
tag-update: ## Update an existing tag to current commit (tag-update version=0.0.0)
@test $(version)
@git push --force origin HEAD:refs/tags/v$(version)
@git fetch --tags -f