-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (49 loc) · 1.15 KB
/
Makefile
File metadata and controls
60 lines (49 loc) · 1.15 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ifndef VERBOSE
MAKEFLAGS += --silent
endif
pkg ?= ./...
pwd = $(shell pwd)
.PHONY: ci-suite
ci-suite: spell-check fmt lint vulnerability-check test
.PHONY: clean
clean:
rm -rf .cache/*
.PHONY: fmt
fmt:
go fmt $(pkg)
.PHONY: lint
lint:
docker pull golangci/golangci-lint:latest > /dev/null \
&& mkdir -p .cache/golangci-lint .cache/go-build \
&& docker run --rm \
-v $(pwd):/app \
-v $(pwd)/.cache:/root/.cache \
-w /app \
golangci/golangci-lint:latest golangci-lint run $(pkg)
.PHONY: release
release:
if [ "$(version)" = "" ]; then \
echo "version is required."; \
exit 1; \
fi \
&& gh release create $(version) --generate-notes --target master
.PHONY: spell-check
spell-check:
docker pull ghcr.io/streetsidesoftware/cspell:latest > /dev/null \
&& docker run --rm \
-v $(pwd):/workdir \
ghcr.io/streetsidesoftware/cspell:latest \
--config /workdir/.vscode/cspell.json "**"
.PHONY: test
test:
go test -cover $(pkg)
.PHONY: test-json
test-json:
go test -cover -json $(pkg)
.PHONY: tidy
tidy:
go mod tidy
.PHONY: vulnerability-check
vulnerability-check:
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck -show=version ./...