forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 3.1 KB
/
Copy pathfuzz.yml
File metadata and controls
98 lines (85 loc) · 3.1 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Contract Fuzzing
on:
push:
branches: [main]
paths:
- 'contracts/**'
schedule:
- cron: '0 2 * * *' # Nightly 02:00 UTC
workflow_dispatch:
jobs:
fuzz:
name: Fuzz Soroban Contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Cache cargo registry
uses: actions/cache@v6
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-fuzz-${{ hashFiles('contracts/fuzz/Cargo.toml') }}
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Fuzz vesting (60s)
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_vesting \
corpus/vesting \
-- -max_total_time=60 -max_len=144
# Extended run of the claim/revoke interleaving harness on the nightly
# schedule (and manual dispatch) only — too slow for every push.
- name: Fuzz vesting extended (10 min, nightly)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_vesting \
corpus/vesting \
-- -max_total_time=600 -max_len=144
# The four targets below depend on contracts that currently do not build
# (see the broken-contracts feature in contracts/fuzz/Cargo.toml); they are
# non-blocking until those crates are repaired.
- name: Fuzz calculate_payout (60s)
continue-on-error: true
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_calculate_payout --features broken-contracts \
corpus/calculate_payout \
-- -max_total_time=60 -max_len=32
- name: Fuzz staking (60s)
continue-on-error: true
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_staking --features broken-contracts \
corpus/staking \
-- -max_total_time=60 -max_len=40
- name: Fuzz token_transfer (60s)
continue-on-error: true
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_token_transfer --features broken-contracts \
corpus/token_transfer \
-- -max_total_time=60 -max_len=48
- name: Fuzz reward_distribution (60s)
continue-on-error: true
working-directory: contracts/fuzz
run: |
cargo fuzz run fuzz_reward_distribution --features broken-contracts \
corpus/reward_distribution \
-- -max_total_time=60 -max_len=40
- name: Upload corpus artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: fuzz-corpus-${{ github.run_id }}
path: |
contracts/fuzz/corpus/
if-no-files-found: ignore
- name: Upload crash artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: fuzz-crashes-${{ github.run_id }}
path: contracts/fuzz/artifacts/
if-no-files-found: ignore