Skip to content

Fuzz - Weekly

Fuzz - Weekly #9

Workflow file for this run

name: Fuzz - Weekly
permissions:
contents: read
issues: write
on:
schedule:
# Run weekly on Sunday at 02:00 UTC. Adjust schedule as needed.
- cron: '0 2 * * 0'
concurrency:
group: schedule-fuzz
cancel-in-progress: true
jobs:
fuzz-weekly:
name: Fuzz (weekly long run)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
with:
go-version-file: go.mod
- name: Run weekly fuzzers
run: |
mkdir -p tmp
set -o pipefail
# Long fuzz-time per function for weekly runs: 120s
make fuzz FUZZ_TIME=120s | tee tmp/fuzz.log
shell: bash
- name: Upload weekly fuzz logs
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: schedule-fuzz-logs
path: tmp/fuzz.log
- name: Prepare log preview
if: always()
run: |
if [ -f tmp/fuzz.log ]; then tail -n 200 tmp/fuzz.log > tmp/fuzz_preview.log || true; else echo "No log file" > tmp/fuzz_preview.log; fi
shell: bash
- name: Create issue on failure
if: ${{ failure() }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const fs = require('fs');
let logPreview = '';
try {
logPreview = fs.readFileSync('tmp/fuzz_preview.log', 'utf8');
} catch (e) {
logPreview = 'No logs available.';
}
const title = `Weekly fuzz failure (run ${context.runId})`;
const body = `The weekly fuzz job failed.\n\n- repo: ${context.repo.owner}/${context.repo.repo}\n- workflow: ${context.workflow}\n- run: ${context.runId}\n- run_url: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}\n\nLog preview (last 200 lines):\n\n\\`\\`\\`\n${logPreview}\n\n\\`\\`\\``;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: title,
body: body,
labels: ['ci', 'fuzz', 'weekly'],
});