From f51fe942376711a9458bc7991ed46fa81f94fb31 Mon Sep 17 00:00:00 2001 From: Dgetsylver <83276742+Dgetsylver@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:07:03 -0400 Subject: [PATCH] ci: build and test Soroban contracts on every PR No workflow currently builds or tests the contracts: parity.yml only builds the rate_calc binary + frontend tests, and blend_leverage is not a cargo workspace member so 'cargo test --workspace' never touches it. This let dev land non-compiling contract code (#157/#217) and let PRs like #233 (deposit traps at runtime) and #235 (proptests don't compile) through with zero contract verification. Adds contracts.yml: cargo test + wasm32v1-none release build for blend_leverage on any PR touching contracts/**. Clippy -D warnings is left as a TODO until the crate's existing digit-grouping lint debt is paid down (would otherwise red every PR immediately). --- .github/workflows/contracts.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/contracts.yml diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml new file mode 100644 index 0000000..9ab1b4c --- /dev/null +++ b/.github/workflows/contracts.yml @@ -0,0 +1,38 @@ +name: Contracts +on: + pull_request: + paths: + - 'contracts/**' + - '.github/workflows/contracts.yml' + push: + branches: [main, dev] + paths: + - 'contracts/**' + +jobs: + blend_leverage: + runs-on: ubuntu-latest + defaults: + run: + working-directory: contracts/strategies/blend_leverage + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32v1-none + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + with: + workspaces: contracts/strategies/blend_leverage + + # TODO: add `cargo clippy --all-targets -- -D warnings` once the + # existing lint debt in the crate (digit grouping etc.) is paid down. + - name: Test + run: cargo test + + - name: Build wasm release + run: cargo build --target wasm32v1-none --release