Skip to content

Fuzz

Fuzz #21

Workflow file for this run

name: Fuzz
on:
schedule:
- cron: '0 3 * * 3' # Weekly on Wednesday at 03:00 UTC
workflow_dispatch:
inputs:
fuzz-time:
description: 'Duration per fuzz target (e.g. 5m, 10m)'
required: false
default: '5m'
jobs:
fuzz:
runs-on: ubuntu-latest
name: "Fuzz"
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Go stable version
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
check-latest: true
cache: false
- name: Restore fuzz cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build/fuzz
key: fuzz-${{ github.run_id }}
restore-keys: |
fuzz-
- name: Run fuzz tests
run: |
FUZZTIME="${{ github.event.inputs.fuzz-time || '5m' }}"
for target in $(go test ./ -list 'Fuzz.*' -run '^$' 2>/dev/null | grep '^Fuzz'); do
echo "::group::${target}"
go test ./ -run '^$' -fuzz "^${target}\$" -fuzztime "${FUZZTIME}"
echo "::endgroup::"
done