-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 867 Bytes
/
Makefile
File metadata and controls
46 lines (35 loc) · 867 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
APP_NAME=maild
MAIN_PACKAGE=./cmd/server
.PHONY: setup run build test tidy fmt-check check-attribution vuln verify verify-full
setup:
@if [ ! -f .env ]; then cp .env.example .env; fi
go mod download
docker compose up -d
run:
go run $(MAIN_PACKAGE)
build:
mkdir -p bin
go build -o bin/$(APP_NAME) $(MAIN_PACKAGE)
test:
go test ./...
tidy:
go mod tidy
fmt-check:
@unformatted="$$(gofmt -l .)"; \
if [ -n "$$unformatted" ]; then \
echo "Unformatted files:"; \
echo "$$unformatted"; \
exit 1; \
fi
check-attribution:
./scripts/check-commit-attribution.sh
verify: fmt-check build test check-attribution
vuln:
@command -v govulncheck >/dev/null 2>&1 || { \
echo "govulncheck not found."; \
echo "Install with:"; \
echo " go install golang.org/x/vuln/cmd/govulncheck@latest"; \
exit 1; \
}
govulncheck ./...
verify-full: verify vuln