From 9af3457a9b087ad74f9a1d0d9ca23705739ec007 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Tue, 24 Nov 2026 13:06:48 +0100 Subject: [PATCH] Update cached fuzz corpus after GitHub workflow run Previously once a cached fuzz corpus existed, it kept using that without updating it. Now it uses unique cache keys, ensuring the fuzz corpus grows over time. Probably not an issue for the cache limits, because the fuzz corpus is relatively small, and if the limits were ever reached, it would simply discard the outdated fuzz corpus caches. Also, by default the cache is only kept for 7 days, so most likely at some point the complete fuzz corpus is discarded and will not grow indefinitely. (Slight disadvantage though because that makes the fuzz corpus less effective.) --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c13070..5d0eaaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,10 @@ jobs: # now and the previous data would be misinterpreted # Don't invalidate when POM or main sources change; fuzz corpus represents LZF data, and that # is unaffected by implementation changes - key: fuzz-corpus-${{ hashFiles('src/test/java/com/ning/compress/lzf/TestFuzzUnsafeLZF.java') }} + # Include `github.run_id` to always update the cache, see https://github.com/actions/cache/blob/v6.1.0/tips-and-workarounds.md#update-a-cache + key: fuzz-corpus-${{ hashFiles('src/test/java/com/ning/compress/lzf/TestFuzzUnsafeLZF.java') }}-${{ github.run_id }} + restore-keys: | + fuzz-corpus-${{ hashFiles('src/test/java/com/ning/compress/lzf/TestFuzzUnsafeLZF.java') }}- - name: Run tests id: fuzz-tests # Don't run with `-q`, to see fuzzing progress