fuzzing.yml: Reproducible toolchain setup (#10487)

This commit is contained in:
oech3
2026-01-26 20:30:32 +01:00
committed by GitHub
parent 6124866934
commit fec6cdf5cf
+8 -6
View File
@@ -58,15 +58,16 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
- name: Install `cargo-fuzz`
run: cargo install cargo-fuzz
run: |
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}" # Use -Z
cargo install cargo-fuzz --locked
- uses: Swatinem/rust-cache@v2
with:
shared-key: "cargo-fuzz-cache-key"
cache-directories: "fuzz/target"
- name: Run `cargo-fuzz build`
run: cargo +nightly fuzz build
run: cargo fuzz build
fuzz-run:
needs: fuzz-build
@@ -102,9 +103,10 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
- name: Install `cargo-fuzz`
run: cargo install cargo-fuzz
run: |
echo "RUSTC_BOOTSTRAP=1" >> "${GITHUB_ENV}" # Use nightly
cargo install cargo-fuzz --locked
- uses: Swatinem/rust-cache@v2
with:
shared-key: "cargo-fuzz-cache-key"
@@ -122,7 +124,7 @@ jobs:
run: |
mkdir -p fuzz/stats
STATS_FILE="fuzz/stats/${{ matrix.test-target.name }}.txt"
cargo +nightly fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -timeout=${{ env.RUN_FOR }} -detect_leaks=0 -print_final_stats=1 2>&1 | tee "$STATS_FILE"
cargo fuzz run ${{ matrix.test-target.name }} -- -max_total_time=${{ env.RUN_FOR }} -timeout=${{ env.RUN_FOR }} -detect_leaks=0 -print_final_stats=1 2>&1 | tee "$STATS_FILE"
# Extract key stats from the output
if grep -q "stat::number_of_executed_units" "$STATS_FILE"; then