Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
#!/bin/bash

set -e
# --- Safety & Environment ---
# set -e: Exit immediately if any command fails.
# set -u: Treat unset variables as an error.
set -eu

# Build
echo "[1/5] Building project in debug mode..."
# Build: Checks for compilation errors.
cargo build

# Check formatting
cargo fmt -- --check

# Run Clippy
cargo clippy -- -D warnings

# Run tests
cargo test
echo "[2/5] Checking code formatting..."
# Rustfmt: Ensures the code follows the official Rust Style Guide.
# The --check flag prevents formatting changes and returns an error if not compliant.
cargo fmt --all -- --check

echo "CI checks passed successfully."
echo "[3/5] Running Clippy lints (Static Analysis)..."
# Clippy: Catching common mistakes and improving your Rust code.
# -D warnings: Promotes all warnings to errors, forcing a clean codebase.
cargo clippy --workspace --all-targets -- -D warnings



echo "[4/5] Running automated tests..."
# Tests: Validates logic and prevents regressions.
# Runs unit, integration, and documentation tests.
cargo test --workspace --no-fail-fast



[Image of Unit Testing and Integration Testing pyramid]


echo "[5/5] Checking for documentation issues..."
# Optional but recommended: Ensures doc comments compile correctly.
cargo doc --no-deps --workspace --document-private-items

echo "--------------------------------------------------"
echo "✅ CI checks passed successfully."
echo "--------------------------------------------------"