Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (95 loc) · 2.74 KB
/
Copy pathMakefile
File metadata and controls
125 lines (95 loc) · 2.74 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
120
121
122
123
124
125
# Makefile for search-sdk-rust
.PHONY: help build test test-unit test-integration test-all clean fmt lint check doc bench install run examples
# Default target
help:
@echo "Available targets:"
@echo " build - Build the project"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration- Run integration tests only"
@echo " test-all - Run all tests with coverage"
@echo " clean - Clean build artifacts"
@echo " fmt - Format code"
@echo " lint - Run clippy linter"
@echo " check - Check code without building"
@echo " doc - Generate documentation"
@echo " bench - Run benchmarks"
@echo " install - Install the binary"
@echo " run - Run the main binary"
@echo " examples - Run example programs"
# Build targets
build:
cargo build
build-release:
cargo build --release
# Test targets
test:
cargo test
test-unit:
cargo test --lib
test-integration:
cargo test --test integration_tests
test-all:
RUST_LOG=debug cargo test --all-features --verbose
test-with-coverage:
cargo test --all-features
@echo "For detailed coverage, install cargo-tarpaulin: cargo install cargo-tarpaulin"
@echo "Then run: cargo tarpaulin --out Html --output-dir coverage"
# Code quality
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
lint:
cargo clippy -- -D warnings
lint-fix:
cargo clippy --fix --allow-dirty
check:
cargo check
check-all:
cargo check --all-targets --all-features
# Documentation
doc:
cargo doc --no-deps --open
doc-private:
cargo doc --no-deps --document-private-items --open
# Benchmarks
bench:
cargo bench
# Install and run
install:
cargo install --path .
run:
cargo run
run-release:
cargo run --release
# Examples
examples:
@echo "Running basic search example..."
cargo run --example basic_search || echo "Create examples/basic_search.rs first"
# Clean up
clean:
cargo clean
# Development workflow
dev-setup:
rustup component add rustfmt clippy
@echo "Development tools installed"
dev-check: fmt-check lint check test
@echo "All development checks passed!"
# CI/CD targets
ci-test: fmt-check lint check test-all
@echo "CI pipeline completed successfully"
# Performance testing
perf-test:
@echo "Running performance tests..."
cargo test --release --test integration_tests test_large_number_of_results -- --nocapture
cargo test --release --test integration_tests test_memory_usage_with_large_content -- --nocapture
# Security audit
audit:
cargo audit || echo "Install cargo-audit: cargo install cargo-audit"
# Update dependencies
update:
cargo update
# Show outdated dependencies
outdated:
cargo outdated || echo "Install cargo-outdated: cargo install cargo-outdated"