-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (68 loc) · 2.31 KB
/
Makefile
File metadata and controls
84 lines (68 loc) · 2.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
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
.PHONY: fmt lint test test-all check build clean install docker-e2e pre-commit pre-push
# Format code
fmt:
cargo fmt
# Check formatting without modifying files
fmt-check:
cargo fmt --check
# Run clippy lints
lint:
cargo clippy --all-targets --all-features -- -D warnings
# Run tests with JUnit XML output
test:
@mkdir -p test-results
cargo nextest run --workspace
# Alias for consistency with other repos
test-all: test
# Pre-commit gate: fast checks (format + lint)
pre-commit: fmt-check lint
@echo "Pre-commit checks passed."
# Pre-push gate: full checks (format + lint + test + build)
pre-push: pre-commit test build
@echo "Pre-push checks passed."
# Legacy alias
check: fmt lint test
@echo "All checks passed!"
# Build release binary
build:
cargo build --release
# Clean build artifacts
clean:
cargo clean
# Install to ~/.cargo/bin
install: build
cp target/release/lattice ~/.cargo/bin/
# Run all smoke tests locally
smoke: build
./target/release/lattice --version
./target/release/lattice list requirements
./target/release/lattice list theses
./target/release/lattice list sources
./target/release/lattice drift
@echo "Smoke tests passed!"
# Run Docker end-to-end integration test (from GitHub release)
docker-e2e:
docker build -t lattice-e2e tests/docker
docker run --rm lattice-e2e
# Run Docker e2e with locally-built source (builds in container)
docker-e2e-local:
docker build -f tests/docker/Dockerfile.local -t lattice-e2e-local .
docker run --rm lattice-e2e-local
# Watch for changes and rebuild (requires cargo-watch)
watch:
cargo watch -x 'build'
# Help
help:
@echo "Available targets:"
@echo " make pre-commit - Check formatting + lint (run before commit)"
@echo " make pre-push - Full check: format + lint + test + build (run before push)"
@echo " make fmt - Format code with cargo fmt"
@echo " make lint - Run clippy lints"
@echo " make test - Run tests (JUnit XML output)"
@echo " make test-all - Alias for test (consistency with other repos)"
@echo " make build - Build release binary"
@echo " make clean - Clean build artifacts"
@echo " make install - Install to ~/.cargo/bin"
@echo " make smoke - Run CLI smoke tests"
@echo " make docker-e2e - Run Docker end-to-end integration test"
@echo " make watch - Watch and rebuild on changes"