ci,test: pin Soroban toolchain, add clippy/audit jobs, and LLM transfer tests #32
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
| # Issue #48 — Contracts CI for the Soroban Rust workspace. | |
| # | |
| # Triggers on push or PR that touches `contracts/**` (or this workflow file). | |
| # Installs the pinned Rust toolchain and the `wasm32-unknown-unknown` target, | |
| # runs `cargo test -p token_transfer`, then builds the release WASM. Cargo's | |
| # registry and `target/` directory are cached on the workflow key so | |
| # subsequent runs skip the dependency rebuild. | |
| name: Contracts CI | |
| on: | |
| push: | |
| paths: | |
| - 'contracts/**' | |
| - '.github/workflows/contracts-ci.yml' | |
| pull_request: | |
| paths: | |
| - 'contracts/**' | |
| - '.github/workflows/contracts-ci.yml' | |
| schedule: | |
| - cron: '0 8 * * 1' # Every Monday at 08:00 UTC | |
| jobs: | |
| test-and-build: | |
| name: cargo test + build (wasm32) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (stable + wasm32 target) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo registry and build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git/db | |
| contracts/target | |
| key: ${{ runner.os }}-cargo-contracts-${{ hashFiles('contracts/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-contracts- | |
| - name: cargo test -p token_transfer | |
| run: cargo test -p token_transfer | |
| - name: cargo build (release wasm32) | |
| run: cargo build -p token_transfer --target wasm32-unknown-unknown --release | |
| clippy: | |
| name: cargo clippy (wasm32) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| components: clippy | |
| - name: Cache cargo registry and build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index | |
| ~/.cargo/registry/cache | |
| ~/.cargo/git/db | |
| contracts/target | |
| key: ${{ runner.os }}-cargo-contracts-${{ hashFiles('contracts/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-contracts- | |
| - name: cargo clippy (wasm32, zero warnings) | |
| run: cargo clippy --workspace --target wasm32-unknown-unknown -- -D warnings -A dead_code -A clippy::too-many-arguments | |
| audit: | |
| name: cargo audit (security) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit --locked | |
| - name: Run cargo audit | |
| run: cargo audit |