Skip to content

feat(contract): implement granular member management with rebalancing… #71

feat(contract): implement granular member management with rebalancing…

feat(contract): implement granular member management with rebalancing… #71

Workflow file for this run

name: Contract CI
on:
push:
branches:
- main
- develop
- paymesh-stellar-issue
paths:
- "contract/**"
- ".github/workflows/contract.yml"
pull_request:
branches:
- main
- develop
- paymesh-stellar-issue
paths:
- "contract/**"
- ".github/workflows/contract.yml"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install wasm32 targets
run: |
rustup target add wasm32-unknown-unknown
rustup target add wasm32v1-none
- name: Install Stellar CLI
run: |
curl -sSLf https://github.com/stellar/stellar-cli/releases/download/v21.4.0/stellar-cli-21.4.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: contract/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Format check
working-directory: contract
run: cargo fmt --all -- --check
- name: Clippy
working-directory: contract
run: cargo clippy --all --all-targets -- -D warnings
- name: Build (native)
working-directory: contract
run: cargo build
# `stellar contract build` emits wasm32v1-none only on newer CLIs; the one
# pinned above still targets wasm32-unknown-unknown, so the verify step
# below never found its artifact. Building through cargo with the target
# the Makefile already uses makes the output path correct by construction
# and drops the dependency on the pinned CLI version.
- name: Build wasm (wasm32v1-none, release)
working-directory: contract
run: cargo build --target wasm32v1-none --release
- name: Verify wasm artifact exists
working-directory: contract
run: |
ls -lh target/wasm32v1-none/release/*.wasm
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install wasm32 targets
run: |
rustup target add wasm32-unknown-unknown
rustup target add wasm32v1-none
- name: Install Stellar CLI
run: |
curl -sSLf https://github.com/stellar/stellar-cli/releases/download/v21.4.0/stellar-cli-21.4.0-x86_64-unknown-linux-gnu.tar.gz | tar xz -C ~/.cargo/bin
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: contract/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run unit + integration tests
working-directory: contract
run: cargo test
- name: Run property-based tests (min 256 cases each)
working-directory: contract
env:
PROPTEST_CASES: 256
run: cargo test prop_ -- --test-threads=1
- name: Upload proptest regression seeds on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: proptest-regressions
path: contract/proptest-regressions/
if-no-files-found: ignore