forked from manifoldco/promptui
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (23 loc) · 713 Bytes
/
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
ci: mod-update test cover
mod-update:
go get -u
go mod tidy
mod-tidy:
go mod tidy
fmt:
go fmt -w $(go list ./... | grep -v generated)
.PHONY: mod-update mod-tidy fmt
test:
go test $(go list ./... | grep -v generated)
.PHONY: test
COVER_TEST_PKGS:=$(shell find . -type f -name '*_test.go' | rev | cut -d "/" -f 2- | rev | grep -v generated | sort -u)
$(COVER_TEST_PKGS:=-cover): %-cover: all-cover.txt
@CGO_ENABLED=0 go test -v [email protected] -covermode=atomic ./$*
@if [ -f [email protected] ]; then \
grep -v "mode: atomic" < [email protected] >> all-cover.txt; \
rm [email protected]; \
fi
all-cover.txt:
echo "mode: atomic" > all-cover.txt
cover: all-cover.txt $(COVER_TEST_PKGS:=-cover)
.PHONY: cover all-cover.txt