forked from GlobalTypeSystem/gts-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (58 loc) · 1.97 KB
/
Copy pathMakefile
File metadata and controls
75 lines (58 loc) · 1.97 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
CI := 1
.PHONY: help build dev-fmt dev-clippy all check fmt clippy test deny security update-spec e2e generate-schemas
# Default target - show help
.DEFAULT_GOAL := help
# Show this help message
help:
@awk '/^# / { desc=substr($$0, 3) } /^[a-zA-Z0-9_-]+:/ && desc { target=$$1; sub(/:$$/, "", target); printf "%-20s - %s\n", target, desc; desc="" }' Makefile | sort
# Build the workspace
build:
cargo build --workspace
cargo build --workspace --release
# Fix formatting issues
dev-fmt:
cargo fmt --all
# Fix clippy issues
dev-clippy:
cargo clippy --fix --workspace
# Generate schemas
generate-schemas: build
./target/release/gts generate-from-rust --source .
# Run all checks and build
all: check deny build generate-schemas
# Check code formatting
fmt:
cargo fmt --all -- --check
# Run clippy linter
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Run all tests
test:
cargo test --workspace
# Check licenses and dependencies
deny:
@command -v cargo-deny >/dev/null || (echo "Installing cargo-deny..." && cargo install cargo-deny)
cargo deny check
# Run all security checks
security: deny
# Measure code coverage
coverage:
@command -v cargo-llvm-cov >/dev/null || (echo "Installing cargo-llvm-cov..." && cargo install cargo-llvm-cov)
cargo llvm-cov --workspace --lcov --output-path lcov.info
cargo llvm-cov report
# Update gts-spec submodule to latest
update-spec:
git submodule update --init --remote .gts-spec
# Run end-to-end tests against gts-spec
e2e: build
@echo "Starting server in background..."
@./target/release/gts server --port 8000 & echo $$! > .server.pid
@sleep 2
@echo "Running e2e tests..."
@PYTHONDONTWRITEBYTECODE=1 pytest -p no:cacheprovider --log-file=e2e.log ./.gts-spec/tests || (kill `cat .server.pid` 2>/dev/null; rm -f .server.pid; exit 1)
@echo "Stopping server..."
@kill `cat .server.pid` 2>/dev/null || true
@rm -f .server.pid
@echo "E2E tests completed successfully"
# Run all quality checks
check: fmt clippy test e2e