Repository navigation
106 lines (101 loc) · 3.24 KB
/
Copy pathfuzz.yml
File metadata and controls
106 lines (101 loc) · 3.24 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
99
100
101
102
103
104
105
106
name: Bounded Fuzzing
on:
pull_request:
branches: [master]
paths:
- 'fuzz/**'
- 'crates/**'
- 'Cargo.*'
- '.github/workflows/fuzz.yml'
- '.github/actions/setup-rust/**'
push:
branches: [master]
paths:
- 'fuzz/**'
- 'crates/**'
- 'Cargo.*'
- '.github/workflows/fuzz.yml'
schedule:
- cron: '23 3 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: fuzz-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
corpus:
name: Stable corpus (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-rust
with:
cache-prefix: fuzz-stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: fuzz
prefix-key: fuzz-corpus
- run: cargo test --manifest-path fuzz/Cargo.toml --locked --test smoke
- run: cargo fmt --manifest-path fuzz/Cargo.toml -- --check
- run: cargo clippy --manifest-path fuzz/Cargo.toml --locked --all-targets -- -D warnings
libfuzzer:
name: ASan (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
target: [csv, json, report, parity]
env:
FUZZ_TARGET: ${{ matrix.target }}
EVENT_NAME: ${{ github.event_name }}
RUSTUP_TOOLCHAIN: nightly-2026-09-01
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-09-01
- uses: Swatinem/rust-cache@v2
with:
workspaces: fuzz
prefix-key: fuzz-asan-${{ matrix.target }}
- name: Install pinned cargo-fuzz
run: cargo install cargo-fuzz --version 0.13.2 --locked
- name: Fetch locked harness dependencies
run: cargo fetch --manifest-path fuzz/Cargo.toml --locked
- name: Replay seeds or run a bounded campaign
shell: bash
env:
CARGO_NET_OFFLINE: 'true'
run: |
mkdir -p "fuzz/corpus/$FUZZ_TARGET"
cp fuzz/seeds/"$FUZZ_TARGET"/* "fuzz/corpus/$FUZZ_TARGET/"
# PRs and pushes replay a fixed corpus. Scheduled/manual runs mutate
# it for five minutes per target, retaining all discoveries.
budget=(-runs=0)
if [[ "$EVENT_NAME" == schedule || "$EVENT_NAME" == workflow_dispatch ]]; then
budget=(-max_total_time=300)
fi
cargo fuzz run "$FUZZ_TARGET" --features fuzzing -- \
"${budget[@]}" -max_len=4096 -timeout=10 -rss_limit_mb=1024 -seed=274
git diff --exit-code -- fuzz/Cargo.lock
- name: Retain crash inputs and evolved corpus
if: always()
uses: actions/upload-artifact@v7
with:
name: fuzz-${{ matrix.target }}-${{ github.run_id }}
path: |
fuzz/artifacts/${{ matrix.target }}/
fuzz/corpus/${{ matrix.target }}/
if-no-files-found: ignore
retention-days: 14