magikrun 0.2.3

Unified OCI runtime for containers, WebAssembly, and microVMs
# =============================================================================
# Makefile - Local CI Checks
# =============================================================================
#
# Run `make ci` before pushing to catch all issues locally.
#
# =============================================================================

.PHONY: ci fmt clippy test doc audit clean

# Run all CI checks locally (mirrors GitHub Actions)
ci: fmt clippy test doc
	@echo "\nโœ… All CI checks passed!"

# Check formatting (same as CI)
fmt:
	@echo "\n๐Ÿ” Checking formatting..."
	cargo fmt -- --check

# Apply formatting fixes
fmt-fix:
	@echo "\n๐Ÿ”ง Applying formatting..."
	cargo fmt

# Run clippy with warnings as errors (same as CI)
clippy:
	@echo "\n๐Ÿ” Running clippy..."
	cargo clippy -- -D warnings

# Run clippy with pedantic warnings (advisory, same as CI)
clippy-pedantic:
	@echo "\n๐Ÿ” Running clippy (pedantic)..."
	cargo clippy -- -W clippy::pedantic

# Run all tests
test:
	@echo "\n๐Ÿงช Running tests..."
	cargo test

# Run doc tests only
test-doc:
	@echo "\n๐Ÿ“š Running doc tests..."
	cargo test --doc

# Run integration tests (requires KVM/HVF)
test-integration:
	@echo "\n๐Ÿ”ฌ Running integration tests..."
	cargo test --release -- --ignored

# Build documentation with warnings as errors (same as CI)
doc:
	@echo "\n๐Ÿ“– Building documentation..."
	RUSTDOCFLAGS="-D warnings" cargo doc --no-deps

# Run security audit (requires cargo-audit: cargo install cargo-audit)
audit:
	@echo "\n๐Ÿ”’ Running security audit..."
	cargo audit

# Full CI including audit (slower, use before release)
ci-full: ci audit
	@echo "\nโœ… All CI + security checks passed!"

# Build release
build:
	@echo "\n๐Ÿ”จ Building release..."
	cargo build --release

# Clean build artifacts
clean:
	@echo "\n๐Ÿงน Cleaning..."
	cargo clean

# Quick check (fast feedback loop)
check:
	@echo "\nโšก Quick check..."
	cargo check

# Pre-push hook equivalent
pre-push: fmt clippy test
	@echo "\nโœ… Ready to push!"