.PHONY: help build test test-unit test-integration test-postgres test-mysql
.PHONY: setup-db start-db stop-db restart-db clean-db logs-db
.PHONY: integration-postgres integration-mysql integration-all
.PHONY: performance benchmark clean cleanup docker-build
.PHONY: lint format check ci
help:
@echo "Hammerwork Job Queue - Available Targets"
@echo "========================================"
@echo ""
@echo "Development:"
@echo " build Build the project"
@echo " test Run all tests"
@echo " test-unit Run unit tests only"
@echo " test-integration Run integration tests without databases"
@echo " lint Run clippy linting"
@echo " format Format code with rustfmt"
@echo " check Run cargo check"
@echo ""
@echo "Database Management:"
@echo " setup-db Start database containers"
@echo " start-db Start database containers"
@echo " stop-db Stop database containers"
@echo " restart-db Restart database containers"
@echo " clean-db Clean database containers and volumes"
@echo " logs-db Show database logs"
@echo ""
@echo "Integration Testing:"
@echo " integration-all Run all integration tests"
@echo " integration-postgres Run PostgreSQL integration tests"
@echo " integration-mysql Run MySQL integration tests"
@echo " test-postgres Run PostgreSQL tests only"
@echo " test-mysql Run MySQL tests only"
@echo ""
@echo "Performance & Benchmarks:"
@echo " performance Run performance benchmarks"
@echo " benchmark Alias for performance"
@echo ""
@echo "Docker:"
@echo " docker-build Build integration Docker images"
@echo " docker-run-postgres Run PostgreSQL integration container"
@echo " docker-run-mysql Run MySQL integration container"
@echo ""
@echo "Cleanup:"
@echo " clean Clean Rust build artifacts"
@echo " cleanup Full cleanup (containers, volumes, images)"
@echo ""
@echo "CI/CD:"
@echo " ci Run all CI checks"
@echo ""
build:
@echo "๐จ Building Hammerwork..."
cargo build
build-release:
@echo "๐จ Building Hammerwork (release)..."
cargo build --release
build-all:
@echo "๐จ Building all workspace members..."
cargo build --workspace
test: test-unit test-integration
@echo "โ
All tests completed"
test-unit:
@echo "๐งช Running unit tests..."
cargo test --lib
test-integration:
@echo "๐งช Running integration tests (without databases)..."
cargo test --test integration_tests
test-postgres:
@echo "๐ Running PostgreSQL tests..."
./scripts/test-postgres.sh
test-mysql:
@echo "๐ฌ Running MySQL tests..."
./scripts/test-mysql.sh
setup-db: start-db
start-db:
@echo "๐๏ธ Starting databases..."
./scripts/setup-db.sh --start
stop-db:
@echo "๐ Stopping databases..."
./scripts/setup-db.sh --stop
restart-db:
@echo "๐ Restarting databases..."
./scripts/setup-db.sh --restart
clean-db:
@echo "๐งน Cleaning databases..."
./scripts/setup-db.sh --clean
logs-db:
@echo "๐ Showing database logs..."
./scripts/setup-db.sh --logs
status-db:
@echo "๐ Checking database status..."
./scripts/setup-db.sh --status
integration-all:
@echo "๐ Running all integration tests..."
./scripts/test-local.sh
integration-postgres:
@echo "๐ Running PostgreSQL integration..."
./scripts/test-local.sh --postgres-only
integration-mysql:
@echo "๐ฌ Running MySQL integration..."
./scripts/test-local.sh --mysql-only
performance: benchmark
benchmark:
@echo "๐๏ธ Running performance benchmarks..."
./scripts/test-local.sh --performance
docker-build:
@echo "๐ณ Building Docker images..."
docker-compose build postgres-integration mysql-integration
docker-run-postgres:
@echo "๐ณ Running PostgreSQL integration container..."
docker-compose --profile integration up --build postgres-integration
docker-run-mysql:
@echo "๐ณ Running MySQL integration container..."
docker-compose --profile integration up --build mysql-integration
lint:
@echo "๐ Running clippy..."
cargo clippy --workspace --all-targets --all-features -- -D warnings
format:
@echo "๐จ Formatting code..."
cargo fmt --all
format-check:
@echo "๐จ Checking code formatting..."
cargo fmt --all -- --check
check:
@echo "๐ Running cargo check..."
cargo check --workspace --all-targets --all-features
postgres-build:
@echo "๐ Building with PostgreSQL features..."
cargo build --features postgres
mysql-build:
@echo "๐ฌ Building with MySQL features..."
cargo build --features mysql
postgres-test:
@echo "๐ Testing PostgreSQL features..."
cargo test --features postgres
mysql-test:
@echo "๐ฌ Testing MySQL features..."
cargo test --features mysql
run-postgres-example:
@echo "๐ Running PostgreSQL example..."
cargo run --example postgres_example --features postgres
run-mysql-example:
@echo "๐ฌ Running MySQL example..."
cargo run --example mysql_example --features mysql
clean:
@echo "๐งน Cleaning build artifacts..."
cargo clean
cleanup:
@echo "๐งน Full cleanup..."
./scripts/cleanup.sh
cleanup-force:
@echo "๐งน Force cleanup..."
./scripts/cleanup.sh --force
ci: format-check lint check test-unit test-integration
@echo "โ
All CI checks passed"
ci-postgres: postgres-build postgres-test integration-postgres
@echo "โ
PostgreSQL CI checks passed"
ci-mysql: mysql-build mysql-test integration-mysql
@echo "โ
MySQL CI checks passed"
dev-setup: start-db
@echo "๐ ๏ธ Development environment ready"
@echo " - Databases started"
@echo " - Run 'make test' to verify setup"
dev-reset: cleanup dev-setup
@echo "๐ Development environment reset"
pre-release: format lint check test integration-all benchmark
@echo "๐ข Pre-release checks completed"
docs:
@echo "๐ Building documentation..."
cargo doc --workspace --all-features
docs-open:
@echo "๐ Opening documentation..."
cargo doc --workspace --all-features --open
update-deps:
@echo "๐ฆ Updating dependencies..."
cargo update
audit:
@echo "๐ Running security audit..."
cargo audit
quick: format check test-unit
@echo "โก Quick development cycle completed"
full: clean build lint test integration-all
@echo "๐ฏ Full development cycle completed"