-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
56 lines (43 loc) · 1.31 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
.PHONY: up down restart logs build \
test test-unit test-integration \
seed lint fmt tidy setup
up:
docker compose up -d --build
down:
docker compose down -v
restart:
docker compose restart api
logs:
docker compose logs -f $(service)
build:
cd backend && go build -o bin/taskflow ./cmd/server
test-unit:
cd backend && go test ./internal/... -v -count=1 -race
test-integration:
docker run -d --name taskflow-test-db \
-e POSTGRES_USER=taskflow_test \
-e POSTGRES_PASSWORD=taskflow_test \
-e POSTGRES_DB=taskflow_test \
-p 5433:5432 \
postgres:16-alpine
@until docker exec taskflow-test-db pg_isready -U taskflow_test > /dev/null 2>&1; do sleep 1; done
@cd backend && \
go test ./tests/integration/... -v -count=1 -timeout 60s; \
STATUS=$$?; \
docker rm -f taskflow-test-db; \
exit $$STATUS
test: test-unit test-integration
seed:
docker compose exec -T api cat scripts/seed.sql | \
docker compose exec -T postgres psql -U taskflow -d taskflow
lint:
cd backend && golangci-lint run ./...
fmt:
cd backend && gofmt -w .
tidy:
cd backend && go mod tidy
setup: up
@until curl -sf http://localhost:8080/healthz > /dev/null 2>&1; do sleep 2; done
$(MAKE) seed
@echo "TaskFlow is running at http://localhost:8080"
@echo "Test credentials: test@example.com / password123"