-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (37 loc) · 1.1 KB
/
Copy pathMakefile
File metadata and controls
52 lines (37 loc) · 1.1 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
.PHONY: dev dev-down dev-logs test test-integration lint fmt vet migrate migrate-down seed build run
ifneq (,$(wildcard .env))
include .env
export
endif
# Bring up Postgres, Redis, and the API via docker-compose.
dev:
docker compose up --build
# Bring up only the infra services (Postgres, Redis) for local `go run`.
dev-infra:
docker compose up -d postgres redis
dev-down:
docker compose down
dev-logs:
docker compose logs -f
# Run the Go test suite (unit tests only — no database required).
test:
cd backend && go test ./... -race -count=1
test-integration:
cd backend && go test -tags=integration ./... -race -count=1 -p 1
# go vet + gofmt check (fails if any file is unformatted).
lint: vet
cd backend && test -z "$$(gofmt -l .)" || (echo "gofmt found unformatted files:"; gofmt -l .; exit 1)
fmt:
cd backend && go fmt ./...
vet:
cd backend && go vet ./...
build:
cd backend && go build -o bin/server ./cmd/server
run:
cd backend && go run ./cmd/server
migrate:
cd backend && go run ./cmd/migrate up
migrate-down:
cd backend && go run ./cmd/migrate down
seed:
cd backend && go run ./cmd/seed