Merge pull request #772 from ZuLu0890/fix/issue-681-bigint-projection… #13
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: Contracts CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| paths: [contracts/**] | |
| pull_request: | |
| paths: [contracts/**] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.91.0 | |
| targets: wasm32v1-none | |
| components: rustfmt, clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: contracts | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run Clippy | |
| run: cargo clippy --workspace -- -D warnings | |
| - name: Run tests | |
| run: "cargo test --features testutils --workspace -- --skip fuzz" | |
| - name: Build WASM (slim) | |
| run: cargo build --workspace --target wasm32v1-none --release --no-default-features | |
| - name: Install wasm-opt | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq binaryen | |
| - name: Check WASM size | |
| run: | | |
| wasm-opt -Oz target/wasm32v1-none/release/indigopay_contract.wasm \ | |
| -o target/wasm32v1-none/release/indigopay_contract.opt.wasm | |
| size=$(stat -c%s target/wasm32v1-none/release/indigopay_contract.opt.wasm) | |
| echo "WASM size (slim + wasm-opt): $size bytes" | |
| if [ $size -gt 65536 ]; then | |
| echo "Error: WASM binary exceeds 64KB limit" | |
| exit 1 | |
| fi | |
| coverage: | |
| name: Coverage | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| defaults: | |
| run: | |
| working-directory: contracts | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.91.0 | |
| components: llvm-tools-preview | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: contracts | |
| - name: Cache cargo-tarpaulin binary | |
| id: tarpaulin-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/bin/cargo-tarpaulin | |
| key: cargo-tarpaulin-${{ runner.os }}-${{ hashFiles('.github/workflows/contracts.yml') }} | |
| - name: Install cargo-tarpaulin | |
| if: steps.tarpaulin-cache.outputs.cache-hit != 'true' | |
| run: cargo install cargo-tarpaulin | |
| - name: Run coverage | |
| run: cargo tarpaulin --config indigopay-contract/.tarpaulin.toml --features testutils --out Html --out Lcov -- --skip fuzz | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: contracts/indigopay-contract/coverage/ |