-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (87 loc) · 2.59 KB
/
Makefile
File metadata and controls
114 lines (87 loc) · 2.59 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
# ClamReef Agent Makefile
.PHONY: help build build-dev build-release test test-unit test-e2e test-doc lint fmt fmt-check clean coverage coverage-check install run dev check ci ci-test bench audit pre-commit release-prep docker-build docker-run
# Default target
help:
@echo "ClamReef Agent - Available targets:"
@echo " build - Build with all features (CI-style)"
@echo " build-release - Build release binary"
@echo " test - Run all tests (CI-style)"
@echo " test-unit - Run unit tests only"
@echo " test-e2e - Run end-to-end tests"
@echo " test-doc - Run documentation tests"
@echo " lint - Run clippy linter (CI-style)"
@echo " fmt - Format code with rustfmt"
@echo " coverage - Generate test coverage report"
@echo " clean - Clean build artifacts"
@echo " install - Install binary to /usr/local/bin"
@echo " run - Run the agent with default config"
@echo " dev - Run in development mode"
@echo " check - Check code without building"
@echo " ci - Run all CI checks (fmt, lint, build, test, coverage, audit)"
# Build targets
build:
cargo build --verbose --all-features
build-dev:
cargo build
build-release:
cargo build --release
# Test targets
test:
cargo test --verbose --all-features
test-unit:
cargo test --lib
test-e2e:
cargo test --test '*' -- --test-threads=1
test-doc:
cargo test --doc
# Code quality
lint:
cargo clippy --all-targets --all-features -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt --check
check:
cargo check
# Coverage
coverage:
cargo tarpaulin --out Html --output-dir target/coverage
coverage-check:
cargo tarpaulin --lib --fail-under 75
# Development
dev:
RUST_LOG=debug cargo run -- --log-level debug
run:
cargo run --release
# Cleanup
clean:
cargo clean
rm -rf target/coverage
# Installation
install: build-release
sudo cp target/release/clamreef-agent /usr/local/bin/
@echo "Installed clamreef-agent to /usr/local/bin/"
# Docker targets
docker-build:
docker build -t clamreef-agent .
docker-run:
docker run --rm -it \
-v /var/run/clamav:/var/run/clamav \
-v $(PWD)/examples:/etc/clamreef \
clamreef-agent
# CI targets - matches GitHub Actions workflow
ci: fmt-check lint build test test-doc coverage-check audit
@echo "✅ All CI checks passed!"
ci-test: lint fmt-check test coverage-check
# Benchmark
bench:
cargo bench
# Security audit
audit:
cargo audit
# Full check before commit
pre-commit: fmt lint test
@echo "All checks passed!"
# Release preparation
release-prep: clean fmt lint test coverage-check audit
@echo "Release preparation complete!"