-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (59 loc) · 2.28 KB
/
Makefile
File metadata and controls
74 lines (59 loc) · 2.28 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
.PHONY: help setup setup-backend setup-frontend dev dev-frontend dev-backend check test fmt lint ci ci-backend ci-frontend ci-cv-explorer
help:
@echo "Available targets:"
@echo " setup Install all dependencies (run once after clone)"
@echo " setup-backend Install cargo-watch"
@echo " setup-frontend Install npm dependencies"
@echo " dev-backend Run lab backend with auto-rebuild"
@echo " dev-frontend Run lab frontend dev server"
@echo " dev Instructions for running both"
@echo " check Check workspace compiles"
@echo " test Run all tests"
@echo " fmt Format code"
@echo " lint Run clippy with warnings as errors"
@echo " ci Run all CI checks (backend + frontend)"
@echo " ci-backend Run backend CI checks (fmt, clippy, test)"
@echo " ci-frontend Run frontend CI checks (lint, build)"
# Install all dependencies
setup: setup-backend setup-frontend
# Install cargo-watch for auto-rebuild
setup-backend:
cargo install cargo-watch
# Install frontend npm dependencies
setup-frontend:
cd frontend && . "$$NVM_DIR/nvm.sh" && nvm use && npm install
# Run lab backend with auto-rebuild on file changes
dev-backend:
cargo watch -x 'run -p lab'
# Run lab frontend dev server (uses .nvmrc for Node version)
dev-frontend:
cd frontend && . "$$NVM_DIR/nvm.sh" && nvm use && npm run dev
# Run both frontend and backend (requires two terminals — use dev-backend + dev-frontend)
dev:
@echo "Run 'make dev-backend' and 'make dev-frontend' in separate terminals"
# Check workspace compiles
check:
cargo check --workspace
# Run all tests
test:
cargo test --workspace
# Format code
fmt:
cargo fmt --all
# Lint
lint:
cargo clippy --workspace -- -D warnings
# Run all CI checks (backend + frontend)
ci: ci-backend ci-frontend
# Run backend CI checks (fmt, clippy, test)
ci-backend:
cargo fmt --all -- --check
cargo clippy --workspace -- -D warnings
cargo test --workspace
# Run frontend CI checks (lint, build) — run setup-frontend first if deps are missing
ci-frontend:
cd frontend && npm run lint && npm run build
# Run Common Voice Explorer CI checks (typecheck worker + build web)
ci-cv-explorer:
cd tools/cv-explorer/worker && npm run typecheck
cd tools/cv-explorer/web && npm run build