135 lines
4.7 KiB
Plaintext
Raw Normal View History

2025-12-18 01:18:59 +00:00
# ╔══════════════════════════════════════════════════════════════════════╗
# ║ CI/CD RECIPES ║
# ║ Validation and deployment tasks ║
# ╚══════════════════════════════════════════════════════════════════════╝
# Help for CI module
help:
@echo "CI/CD MODULE"
@echo ""
@echo "Validation:"
@echo " just ci::lint Lint all code"
@echo " just ci::test-all Test all features"
@echo " just ci::check Check + format + lint"
@echo " just ci::audit Audit dependencies (security)"
@echo ""
@echo "Compliance:"
@echo " just ci::verify-sbom Verify SBOMs are up to date"
@echo ""
@echo "Build validation:"
@echo " just ci::build-debug Debug build"
@echo " just ci::build-release Release build"
@echo ""
@echo "Full pipeline:"
@echo " just ci::full Complete CI: check + test + build"
# === VALIDATION STAGE ===
# Format check
[doc("Check format")]
fmt-check:
@echo "=== Format validation ==="
cargo fmt --all -- --check
@echo "✓ Format valid"
# Lint
[doc("Run clippy")]
lint:
@echo "=== Linting ==="
cargo clippy --all-targets --all-features -- -D warnings
@echo "✓ Lint passed"
# Check formatting and linting
[doc("Check: format + lint")]
check:
just ci::fmt-check
just ci::lint
@echo "✓ All checks passed"
# === TEST STAGE ===
# Test all features
[doc("Test all features")]
test-all:
@echo "=== Testing (all features) ==="
cargo test --workspace --all-features
@echo "✓ All tests passed"
# Test default features
[doc("Test default features")]
test-default:
@echo "=== Testing (default features) ==="
cargo test --workspace
@echo "✓ Tests passed (default features)"
# Test integration only
[doc("Test integration")]
test-integration:
@echo "=== Testing integration ==="
cargo test --test '*' --all-features
@echo "✓ Integration tests passed"
# === BUILD STAGE ===
# Debug build
[doc("Build debug")]
build-debug:
@echo "=== Building debug ==="
cargo build --workspace --all-features
@echo "✓ Debug build complete"
# Release build
[doc("Build release")]
build-release:
@echo "=== Building release (optimized) ==="
cargo build --workspace --all-features --release
@echo ""
@echo "Binaries:"
@ls -lh target/release/typedialog* 2>/dev/null | awk '{printf " %-30s %8s\n", $NF, $5}'
@echo "✓ Release build complete"
# === COMPLIANCE STAGE ===
# Audit dependencies for security issues
[doc("Audit dependencies for vulnerabilities")]
audit:
@echo "=== Auditing dependencies ==="
cargo audit
@echo "✓ Security audit passed"
# Verify SBOMs are current
[doc("Verify SBOMs are up to date")]
verify-sbom:
@echo "=== Verifying SBOMs ==="
@echo "Regenerating SBOMs to check for changes..."
python3 "{{ justfile_directory() }}/scripts/generate_sbom.py" > /tmp/sbom_current.txt 2>&1
@echo "✓ SBOMs verified"
# === FULL PIPELINE ===
# Complete CI pipeline
[doc("Full CI: check + test + build")]
full:
@echo "╔═══════════════════════════════════════════════════════════╗"
@echo "║ TYPEDIALOG CI/CD PIPELINE ║"
@echo "╚═══════════════════════════════════════════════════════════╝"
@echo ""
@echo "=== Stage 1: Validation ==="
just ci::check
@echo ""
@echo "=== Stage 2: Compliance ==="
just ci::verify-sbom
@echo ""
@echo "=== Stage 3: Testing ==="
just ci::test-all
@echo ""
@echo "=== Stage 4: Build Debug ==="
just ci::build-debug
@echo ""
@echo "=== Stage 5: Build Release ==="
just ci::build-release
@echo ""
@echo "╔═══════════════════════════════════════════════════════════╗"
@echo "║ CI PIPELINE COMPLETE ✓ ║"
@echo "╚═══════════════════════════════════════════════════════════╝"