forked from kamilsk/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (25 loc) · 1.07 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
SHELL := /bin/bash -euo pipefail
.PHONY: deps
deps:
@(go mod tidy && go mod vendor && go mod verify)
.PHONY: goimports
goimports:
@(goimports -ungroup -w .)
.PHONY: test
test: #| Runs tests with race.
@(go test -race -timeout 1s ./...)
.PHONY: test-check
test-check: #| Fast runs tests to check their compilation errors.
@(go test -run=^hack ./...)
.PHONY: test-with-coverage
test-with-coverage: #| Runs tests with coverage.
@(go test -cover -timeout 1s ./...)
.PHONY: test-with-coverage-formatted
test-with-coverage-formatted: #| Runs tests with coverage and formats the result.
@(go test -cover -timeout 1s ./... | column -t | sort -r)
.PHONY: test-with-coverage-profile
test-with-coverage-profile: #| Runs tests with coverage and collects the result.
@(go test -covermode count -coverprofile cover.out -timeout 1s ./...)
.PHONY: test-example
test-example: #| Runs example tests with coverage and collects the result.
@(go test -covermode count -coverprofile -run=Example -timeout 1s -v example.out ./...)