-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 1.04 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
.PHONY: check-gocritic run-gocritic check-gosec run-gosec run-tests check-golangci-lint run-golangci-lint
all: check-gocritic run-gocritic check-gosec run-gosec check-golangci-lint run-golangci-lint run-tests
check-gocritic:
@command -v gocritic >/dev/null 2>&1 || { echo >&2 "gocritic is not installed. Please install it."; exit 1; }
run-gocritic:
gocritic check ./...
check-gosec:
@command -v gosec >/dev/null 2>&1 || { echo >&2 "gosec is not installed. Please install it."; exit 1; }
run-gosec:
gosec ./...
check-golangci-lint:
@command -v golangci-lint >/dev/null 2>&1 || { echo >&2 "golangci-lint is not installed. Please install it."; exit 1; }
run-golangci-lint:
golangci-lint run ./...
run-tests:
@echo "Checking health of bundler..."
@HEALTH_CHECK=$$(curl -s "localhost:3000/health"); \
if [ "$$HEALTH_CHECK" = "\"ok\"" ]; then \
go test -v ./...; \
else \
echo "Bundler service is not running."; \
exit 1; \
fi
get-coverage:
go test -coverprofile=c.out ./...
go tool cover -html=c.out -o coverage.html
open coverage.html