-
Notifications
You must be signed in to change notification settings - Fork 210
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (23 loc) · 739 Bytes
/
Makefile
File metadata and controls
32 lines (23 loc) · 739 Bytes
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
.PHONY: all
all: build test
ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")
setup:
mkdir -p $(GOPATH)/bin
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
go install github.com/mattn/goveralls@v0.0.12
compile:
mkdir -p out/
go build -race ./...
build: compile fmt lint
fmt:
go fmt ./...
lint:
golangci-lint run ./...
test: fmt build
ENVIRONMENT=test go test -race -covermode=atomic -coverprofile=coverage.out ./...
test-cover-html:
@echo "mode: count" > coverage-all.out
$(foreach pkg, $(ALL_PACKAGES),\
ENVIRONMENT=test go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out -o out/coverage.html