-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (31 loc) · 782 Bytes
/
Copy pathMakefile
File metadata and controls
44 lines (31 loc) · 782 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
.PHONY: up down build run test test-race test-integration coverage lint fmt logs migrate-up migrate-down
up:
docker compose up --build -d
down:
docker compose down
build:
CGO_ENABLED=0 go build -ldflags="-w -s" -o snip ./cmd/api
run:
go run ./cmd/api
test:
go test ./... -v
test-race:
CGO_ENABLED=1 go test ./... -v -race
lint:
golangci-lint run ./...
fmt:
gofmt -w .
goimports -w .
logs:
docker compose logs -f api
test-integration:
go test ./tests/integration/... -v -tags=integration
coverage:
go test ./internal/... -coverprofile=coverage.out
@go tool cover -func=coverage.out | tail -1
go tool cover -html=coverage.out -o coverage.html
@echo "HTML report: coverage.html"
migrate-up:
go run ./cmd/migrate up
migrate-down:
go run ./cmd/migrate down