install-tools:
@echo "๐ง Installing development tools..."
cargo install cargo-tarpaulin
format-check:
@echo "๐จ Checking code formatting..."
cargo fmt --all -- --check
format:
@echo "๐จ Formatting code..."
cargo fmt --all
clippy:
@echo "๐ Running clippy on production code..."
cargo clippy --workspace --lib --bins -- -D warnings
@echo "โ
Production code clippy check passed"
test:
@echo "๐งช Running unit and integration tests..."
cargo test --workspace --all-features -- --nocapture
coverage:
@echo "๐ Measuring code coverage..."
cargo tarpaulin --timeout 240 --skip-clean --workspace --lib --out Xml
@if [ -f "cobertura.xml" ]; then \
COVERAGE=$$(sed -n 's/.*<coverage[^>]*line-rate="\([^"]*\)".*/\1/p' cobertura.xml); \
if [ -n "$$COVERAGE" ]; then \
COVERAGE_PERCENT=$$(echo "$$COVERAGE" | awk '{printf "%.2f", $$1 * 100}'); \
echo "๐ Code coverage: $${COVERAGE_PERCENT}%"; \
if [ $$(echo "$$COVERAGE < 0.8" | bc -l) -eq 1 ]; then \
echo "โ Code coverage below 80%"; \
exit 1; \
else \
echo "โ
Code coverage is sufficient"; \
fi; \
else \
echo "โ Failed to extract coverage value"; \
exit 1; \
fi; \
else \
echo "โ Coverage report not generated"; \
exit 1; \
fi
pre-commit: format-check clippy test coverage
@echo "๐ All pre-commit checks passed!"
dev: install-tools pre-commit
@echo "๐ Development workflow completed successfully!"
check: format-check clippy test
@echo "โ
Quick checks passed!"
.PHONY: install-tools format-check format clippy test coverage pre-commit dev check qa qa-unix qa-windows qa-validate qa-summary
qa:
@echo "๐ Running QA smoke tests with full output..."
cargo test smoke -- --nocapture
qa-unix:
@echo "๐ง Running Unix workflow smoke tests..."
cargo test test_workflow_smoke_tests_unix -- --nocapture
qa-windows:
@echo "๐ช Running Windows workflow smoke tests..."
cargo test test_workflow_smoke_tests_windows -- --nocapture
qa-validate:
@echo "โ
Validating all workflow YAML files..."
cargo test test_workflow_file_validation -- --nocapture
qa-summary:
@echo "๐ Running QA summary tests..."
cargo test test_qa_workflow_summary