-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.54 KB
/
Copy pathfuzz.yml
File metadata and controls
46 lines (44 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
on:
schedule:
- cron: "30 2 * * 1"
workflow_dispatch:
permissions: {}
jobs:
fuzz:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
- name: Run all fuzz targets
run: |
for pkg in $(go list ./...); do
for target in $(go test -list '^Fuzz' "$pkg" | grep '^Fuzz' || true); do
go test -run '^$' -fuzz "^${target}\$" -fuzztime 5m "$pkg"
done
done
env:
GOFLAGS: -mod=readonly
- name: Upload crashing inputs
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fuzz-crashers
path: '**/testdata/fuzz/**'
retention-days: 30
- name: Open an issue on failure
if: failure()
run: |
title="Weekly fuzzing found a failing input"
if [ -z "$(gh issue list --state open --search "$title in:title" --json number --jq '.[0].number')" ]; then
gh issue create --title "$title" \
--body "Failed run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}. The crashing input is in the fuzz-crashers artifact of that run."
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}