-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
119 lines (84 loc) · 3.17 KB
/
Makefile
File metadata and controls
119 lines (84 loc) · 3.17 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
DC = docker compose -f docker-compose.dev.yml
# ── Dev environment ──────────────────────────────────────────
.PHONY: up down build restart logs
up:
$(DC) up -d
down:
$(DC) down
build:
$(DC) up -d --build
restart:
$(DC) restart
logs:
$(DC) logs -f
logs-backend:
$(DC) logs -f backend
logs-frontend:
$(DC) logs -f frontend
# ── Backend ──────────────────────────────────────────────────
.PHONY: test test-cov test-file lint lint-fix fmt typecheck check shell-backend
test:
$(DC) exec backend pytest tests/ -v
test-cov:
$(DC) exec backend pytest tests/ --cov=backend --cov-report=term-missing
test-file:
@test -n "$(F)" || (echo "Usage: make test-file F=tests/unit/test_pipeline.py" && exit 1)
$(DC) exec backend pytest $(F) -v
lint:
$(DC) exec backend ruff check backend/ tests/
lint-fix:
$(DC) exec backend ruff check backend/ tests/ --fix
fmt:
$(DC) exec backend ruff format backend/ tests/
typecheck:
$(DC) exec backend pyright backend/
check: lint-fix fmt typecheck test
shell-backend:
$(DC) exec backend bash
# ── Frontend ─────────────────────────────────────────────────
.PHONY: ftest ftest-cov flint flint-fix shell-frontend
ftest:
$(DC) exec frontend npm test
ftest-cov:
$(DC) exec frontend npm run test:coverage
flint:
$(DC) exec frontend npm run lint
flint-fix:
$(DC) exec frontend npm run lint:fix
shell-frontend:
$(DC) exec frontend bash
# ── Database ─────────────────────────────────────────────────
.PHONY: migrate migrate-new db-shell
migrate:
$(DC) exec backend alembic upgrade head
migrate-new:
@test -n "$(MSG)" || (echo "Usage: make migrate-new MSG='add_users_table'" && exit 1)
$(DC) exec backend alembic revision --autogenerate -m "$(MSG)"
db-shell:
$(DC) exec postgres psql -U agentickode -d agentickode
# ── Git hooks ────────────────────────────────────────────────
.PHONY: hooks
hooks:
bash scripts/setup-hooks.sh
# ── CI (mirrors GitHub Actions) ──────────────────────────────
.PHONY: ci ci-backend ci-frontend ci-push
ci-backend:
@echo "=== Backend: lint ==="
$(DC) exec backend ruff check backend/ tests/
@echo "=== Backend: format check ==="
$(DC) exec backend ruff format --check backend/ tests/
@echo "=== Backend: type check ==="
$(DC) exec backend pyright backend/
@echo "=== Backend: tests ==="
$(DC) exec backend pytest tests/ -v --cov=backend --cov-report=term-missing
ci-frontend:
@echo "=== Frontend: lint ==="
$(DC) exec frontend npm run lint
@echo "=== Frontend: type check ==="
$(DC) exec frontend npx tsc -b
@echo "=== Frontend: tests ==="
$(DC) exec frontend npm run test:coverage
ci: ci-backend ci-frontend
@echo "=== All CI checks passed ==="
ci-push: ci
git push