docs: CONTRIBUTING guide section on adding invoice options (#703) #492
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
| name: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run tests | |
| run: cargo test --workspace | |
| - name: Build WASM and check size | |
| run: | | |
| cargo build --target wasm32-unknown-unknown --release --package split | |
| WASM_SIZE=$(stat -c%s target/wasm32-unknown-unknown/release/split.wasm) | |
| echo "WASM size: $WASM_SIZE bytes" | |
| # Threshold: 600 KB (614400 bytes). The release profile already uses | |
| # opt-level="z", lto=true, and strip="symbols". The raw WASM before | |
| # wasm-opt is ~540 KB for the current feature set; 600 KB leaves ~60 KB | |
| # headroom and will alert if the contract grows significantly. | |
| if [ $WASM_SIZE -gt 614400 ]; then | |
| echo "ERROR: WASM size ($WASM_SIZE bytes) exceeds 600 KB threshold" | |
| exit 1 | |
| fi | |
| echo "WASM size check passed ($WASM_SIZE bytes <= 614400 bytes)" | |
| - name: Storage key snapshot test | |
| run: cargo test -p split storage_snapshot | |
| fuzz: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install nightly Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| fuzz/target | |
| key: ${{ runner.os }}-cargo-fuzz-${{ hashFiles('fuzz/Cargo.toml') }} | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz | |
| - name: Fuzz create_invoice (60s) | |
| run: cargo fuzz run fuzz_create_invoice -- -max_total_time=60 | |
| - name: Fuzz pay (60s) | |
| run: cargo fuzz run fuzz_pay -- -max_total_time=60 | |
| - name: Fuzz release (60s) | |
| run: cargo fuzz run fuzz_release -- -max_total_time=60 | |
| - name: Fuzz refund (60s) | |
| run: cargo fuzz run fuzz_refund -- -max_total_time=60 | |
| - name: Fuzz sequence (60s) | |
| run: cargo fuzz run fuzz_sequence -- -max_total_time=60 |