name: Stress Tests
on:
schedule:
- cron: '0 4 * * 1' workflow_dispatch:
concurrency:
group: stress-${{ github.sha }}
cancel-in-progress: true
jobs:
stress:
runs-on: ubuntu-latest
strategy:
matrix:
iteration: [1, 2, 3]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Checkout provable-contracts (path dep)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with:
repository: paiml/provable-contracts
path: provable-contracts
- name: Symlink provable-contracts for Cargo path deps
run: ln -sf "$GITHUB_WORKSPACE/provable-contracts" "$GITHUB_WORKSPACE/../provable-contracts"
- name: Install Rust toolchain
run: rustup show
- name: Cache cargo
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stress-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Generate contract assertions — pv codegen
run: |
if ! command -v pv >/dev/null 2>&1; then
cargo install provable-contracts-cli --locked || true
fi
PV=$(command -v pv 2>/dev/null || true)
if [ -z "$PV" ]; then
echo "::warning::pv not found — skipping contract generation"
else
PC_CONTRACTS="$GITHUB_WORKSPACE/../provable-contracts/contracts"
if [ -f src/lib.rs ] && grep -q 'mod generated_contracts' src/lib.rs && [ ! -f src/generated_contracts.rs ]; then
if [ -d "$PC_CONTRACTS" ]; then
"$PV" codegen "$PC_CONTRACTS" -o src/generated_contracts.rs || true
elif [ -d contracts ]; then
"$PV" codegen contracts/ -o src/generated_contracts.rs || true
fi
fi
fi
- name: Stress test iteration ${{ matrix.iteration }}
run: |
for run in $(seq 1 10); do
echo "=== Run $run/10 ==="
cargo test --lib -- --test-threads=1
done
timeout-minutes: 30