Skip to content

Commit 6cd3f8f

Browse files
committed
persist fuzz corpus between CI runs
1 parent cc1355f commit 6cd3f8f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,27 @@ jobs:
267267
- name: Install Rust 1.80 toolchain
268268
run: |
269269
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain 1.80
270+
# This is read-only for PRs. It seeds the fuzzer for a more effective run.
271+
# NOTE: The `key` is unique and will always miss, forcing a fallback to
272+
# the `restore-keys` to find the latest global cache from the `main` branch.
273+
- name: Restore persistent fuzz corpus (PR)
274+
if: ${{ github.ref != 'refs/heads/main' }}
275+
uses: actions/cache/restore@v4
276+
with:
277+
path: fuzz/hfuzz_workspace
278+
key: fuzz-corpus-${{ github.ref }}-${{ github.sha }}
279+
restore-keys: |
280+
fuzz-corpus-refs/heads/main-
281+
# Only on the `main` branch, restores the latest corpus and also save a
282+
# new, updated one.
283+
- name: Restore/Save persistent honggfuzz corpus (Main)
284+
if: ${{ github.ref == 'refs/heads/main' }}
285+
uses: actions/cache@v4
286+
with:
287+
path: fuzz/hfuzz_workspace
288+
key: fuzz-corpus-refs/heads/main-${{ github.sha }}
289+
restore-keys: |
290+
fuzz-corpus-refs/heads/main-
270291
- name: Sanity check fuzz targets on Rust 1.80
271292
run: |
272293
cd fuzz

0 commit comments

Comments
 (0)