-
-
Notifications
You must be signed in to change notification settings - Fork 19
89 lines (78 loc) · 2.13 KB
/
fuzz.yml
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
name: cargo-fuzz
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
FUZZ_TIME: 300
FUZZ_JOBS: 2
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-protoc
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
shared-key: fuzz
prefix-key: v1-rust
- uses: dtolnay/install@cargo-fuzz
- name: cargo build
shell: bash
run: |
export CARGO_TARGET_DIR=$(pwd)/target
for target in protocol/admin protocol/memcache protocol/ping protocol/thrift storage/segcache; do
cd src/$target
echo "::group::Building $target"
cargo fuzz build
echo "::endgroup::"
cd - > /dev/null
done
fuzz:
strategy:
matrix:
os: [ ubuntu-latest ]
target: [
protocol/admin,
protocol/memcache,
protocol/ping,
protocol/resp,
protocol/thrift,
storage/segcache,
]
name: fuzz-${{ matrix.os }}-${{ matrix.target }}
runs-on: ${{ matrix.os }}
needs: [ build ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-protoc
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
shared-key: fuzz
prefix-key: v1-rust
save-if: false
- uses: dtolnay/install@cargo-fuzz
- name: fuzz ${{ matrix.target }}
run: |
export CARGO_TARGET_DIR=$(pwd)/target
cd src/${{ matrix.target }}
for FUZZ_TARGET in `cargo fuzz list`; do
cargo fuzz run ${FUZZ_TARGET} --jobs ${{ env.FUZZ_JOBS }} -- \
-max_total_time=${{ env.FUZZ_TIME }};
done
check-success:
name: verify all fuzz tests pass
runs-on: ubuntu-latest
needs:
- build
- fuzz
steps:
- name: no-op
run: |
echo "All checks passed!"