-
Notifications
You must be signed in to change notification settings - Fork 107
82 lines (65 loc) · 2.17 KB
/
Copy pathtest.yml
File metadata and controls
82 lines (65 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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"
if [ $WASM_SIZE -gt 65536 ]; then
echo "ERROR: WASM size ($WASM_SIZE bytes) exceeds 64 KB threshold"
exit 1
fi
echo "WASM size check passed ($WASM_SIZE bytes <= 65536 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