docs(contract): improve invariant test guidance #431
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Smart Contract CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "stellar-contracts/**" | |
| - ".github/workflows/contracts.yml" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "stellar-contracts/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test & Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: stellar-contracts | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| stellar-contracts/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('stellar-contracts/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Run tests | |
| run: cargo test | |
| - name: Build WASM release | |
| run: cargo build --target wasm32-unknown-unknown --release | |
| - name: Check WASM size | |
| run: | | |
| ls -la target/wasm32-unknown-unknown/release/*.wasm | |
| SIZE=$(ls -la target/wasm32-unknown-unknown/release/*.wasm | awk '{print $5}') | |
| echo "Current WASM size: $SIZE bytes" | |
| if [ $SIZE -gt 55000 ]; then | |
| echo "Error: WASM size $SIZE bytes exceeds 55 KB limit" | |
| exit 1 | |
| fi | |
| - name: Run clippy (deny warnings) | |
| run: cargo clippy --all-targets --all-features -- -D warnings |