forked from Savitura/Fluxa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (36 loc) · 935 Bytes
/
Copy pathMakefile
File metadata and controls
46 lines (36 loc) · 935 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
.PHONY: run-api run-worker migrate migrate-down test lint build tidy
# Run the API server
run-api:
go run ./cmd/api
# Run the background worker
run-worker:
go run ./cmd/worker
# Apply all pending migrations
migrate:
go run ./cmd/api -migrate-only
# Roll back the last migration
migrate-down:
@if [ -z "$$DATABASE_URL" ]; then \
echo "DATABASE_URL is not set"; exit 1; \
fi
migrate -path db/migrations -database "$$DATABASE_URL" down 1
# Run all tests with race detector
test:
go test ./... -race -count=1 -timeout 60s
# Run tests with coverage
test-cover:
go test ./... -race -count=1 -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
# Lint
lint:
golangci-lint run ./...
# Build both binaries
build:
go build -o bin/api ./cmd/api
go build -o bin/worker ./cmd/worker
# Tidy dependencies
tidy:
go mod tidy
# Generate sqlc (if using sqlc for query generation)
generate:
sqlc generate