CI – Build & Test Soroban Contracts #2
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: CI – Build & Test Soroban Contracts | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build Soroban Contracts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: "1.85.0" | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Pin incompatible dependencies | |
| working-directory: smartcontract | |
| run: | | |
| cargo update serde_with@3.18.0 --precise 3.17.0 || true | |
| cargo update serde_with_macros@3.18.0 --precise 3.17.0 || true | |
| cargo update darling@0.23.0 --precise 0.21.3 || true | |
| cargo update darling_core@0.23.0 --precise 0.21.3 || true | |
| cargo update darling_macro@0.23.0 --precise 0.21.3 || true | |
| cargo update indexmap@2.14.0 --precise 2.6.0 || true | |
| - name: Build Factory contract | |
| working-directory: smartcontract | |
| run: cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/factory/Cargo.toml | |
| - name: Build Rotational contract | |
| working-directory: smartcontract | |
| run: cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/rotational/Cargo.toml | |
| - name: Build Target contract | |
| working-directory: smartcontract | |
| run: cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/target/Cargo.toml | |
| - name: Build Flexible contract | |
| working-directory: smartcontract | |
| run: cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/flexible/Cargo.toml | |
| - name: Verify WASM artifacts | |
| working-directory: smartcontract | |
| run: | | |
| ls -lh target/wasm32-unknown-unknown/release/*.wasm | |
| echo "All contracts built successfully" |