This directory contains utility scripts for local development and testing that complement the CI workflows.
# Run development checks
./scripts/dev-checks.sh
# Check binary size changes
./scripts/size-check.sh
# Run security and memory safety tests
./scripts/security.sh
# Run performance benchmarks
./scripts/bench.sh
Runs comprehensive development checks including formatting, linting, and tests.
Features:
- Code formatting checks (
cargo fmt
) - Linting with Clippy
- Unit tests
- Integration tests
- Documentation tests
Analyzes binary size changes to detect bloat and track optimization efforts.
Features:
- Binary size comparison
- Dependency analysis
- Size regression detection
Comprehensive security and memory safety testing framework.
Features:
- Multi-tool testing (Miri, Sanitizers, Valgrind, Audit)
- Cross-platform support (Linux, macOS, Windows, ARM64)
- Graceful degradation when tools unavailable
- Configurable test categories and timeouts
- Color-coded output with progress indicators
Usage:
# Run all available tests
./scripts/security.sh
# Run specific test categories
./scripts/security.sh --miri-only
./scripts/security.sh --sanitizers-only
./scripts/security.sh --audit-only
# Platform-specific testing
./scripts/security.sh --platform linux --timeout 300
Local performance benchmarking with regression detection.
Features:
- Criterion benchmark integration
- Baseline creation and comparison
- Automatic test package detection
- Configurable regression thresholds
- HTML report generation
- Local development focus
Usage:
# Standard benchmark run
./scripts/bench.sh
# Create and compare baselines
./scripts/bench.sh --save my-baseline
./scripts/bench.sh --load my-baseline --threshold 3%
# Development workflow
./scripts/bench.sh --clean --open --test-package ./examples
Note: Benchmarks are designed for local development only. CI environments introduce too much variability for reliable performance measurement.
- Rust toolchain (automatically managed via
rust-toolchain.toml
) - Basic build tools
sudo apt-get update
sudo apt-get install -y valgrind bc gnuplot build-essential
brew install gnuplot
# Optional: brew install valgrind (limited support)
- Visual Studio Build Tools
- Optional: Install gnuplot for enhanced benchmark reports
These scripts are designed to complement CI workflows where applicable:
security.sh
↔.github/workflows/security.yml
: Same security analysis tools
Note: Benchmarking (bench.sh
) is intentionally local-only due to CI environment variability.
The scripts integrate with workflows where appropriate:
security.yml
: Runs comprehensive security testing across platforms
bench.sh
: Local-only performance testing (not suitable for CI)dev-checks.sh
: Can be used in CI for code quality checks
# Run all development checks
./scripts/dev-checks.sh
# Run security tests
./scripts/security.sh
# Check performance impact (local only)
./scripts/bench.sh
# Check binary size impact
./scripts/size-check.sh
For setting up a development environment, ensure you have the platform-specific tools listed in the Prerequisites section above.
chmod +x scripts/*.sh
Run the setup script or check platform-specific installation commands above.
- Check workflow logs for specific error messages
- Verify
rust-toolchain.toml
compatibility - Ensure scripts have execution permissions
- Test locally with the same script used in CI
All scripts follow common patterns:
- Color-coded output with emoji indicators
- Progressive enhancement based on available tools
- Comprehensive help text with examples
- Error handling with remediation suggestions
- Cross-platform compatibility with platform-specific optimizations