-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
33 lines (25 loc) · 1.02 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
.DEFAULT_GOAL:=build
.PHONY: build
build:
go build ./...
.PHONY: install
install:
go mod download
.PHONY: test
test:
go test -cover -timeout 30s -race ./...
.PHONY: docs
docs:
go build
# Automatically update the Usage section of README.md with --help (wrapped to 80 characters).
screen -d -m bash -c 'stty cols 80 && $(CURDIR)/yab --help | python -c "import re; import sys; f = open(\"README.md\"); r = re.compile(r\"\`\`\`\nUsage:.*?\`\`\`\", re.MULTILINE|re.DOTALL); print r.sub(\"\`\`\`\n\" + sys.stdin.read() + \"\`\`\`\", f.read().strip())" | sponge README.md'
# Update our manpage output and HTML pages.
$(CURDIR)/yab --man-page > man/yab.1
groff -man -T html man/yab.1 > man/yab.html
[[ -d ../yab_ghpages ]] && cp man/yab.html ../yab_ghpages/man.html
@echo "Please update gh-pages"
.PHONY: test_ci
test_ci: install build
go test -timeout 30s -race -coverprofile=cover_temp.out -coverpkg=./... ./...
grep -v "^github.com/yarpc/yab/testdata/*" cover_temp.out > cover.out
go tool cover -html=cover.out -o cover.html