The GitHub Actions workflow (.github/workflows/rust-ci.yml) runs three checks:
- Code Formatting -
cargo fmt --all -- --check - Clippy Linting -
cargo clippy -- -D warnings - Unit Tests -
cargo test
# Install Rust and Soroban CLI
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install --locked soroban-cli./ci-check.shcd contracts
# Format check
cargo fmt --all -- --check
# Lint check
cargo clippy -- -D warnings
# Test check
cargo test
# Build for deployment
soroban contract build✅ Formatting: Code follows Rust 2021 edition standards ✅ Linting: No clippy warnings (all types properly derived) ✅ Tests: Existing tests pass (test_hello, test_init) ✅ Compilation: Uses correct Soroban SDK types ✅ Module Structure: types.rs properly exposed in lib.rs
- Exposes
typesmodule - Re-exports
StreamandDataKey - Contains HelloContract with tests
Streamstruct with all required fieldsDataKeyenum for storage- Proper
#[contracttype]attributes - Standard derives (Clone, Debug, Eq, PartialEq)
All checks should PASS because:
- Code follows standard Rust formatting conventions
- No unused imports or variables (prefixed with
_where needed) - All types have required derives for Soroban
- Tests are properly structured and will compile
- No warnings or errors in the codebase
If CI fails, check:
- Rust toolchain version matches CI (stable)
- soroban-sdk version is 22.0.0
- wasm32-unknown-unknown target is installed
- No uncommitted formatting changes