Fuzz Testing #439
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fuzz Testing | |
on: | |
# Perform Fuzz testing on PRs and on a daily basis. Daily will continue to | |
# look for problems. Doing this on PRs will look for issues introduced in | |
# a change. | |
pull_request: | |
schedule: | |
- cron: '33 23 * * *' # Run at 11:33 every day | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
cache-key: fuzzing | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
# The cache path may be different on different runners. GitHub may change | |
# this in the future. So, we dynamically fetch it. | |
- name: Get Go Cache Paths | |
id: go-cache-paths | |
run: | | |
echo "::set-output name=go-build::$(go env GOCACHE)" | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Restore Cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ env.cache-key }} | |
- name: Fuzz | |
run: make fuzz | |
# Cannot overwrite the existing cache (id's are immutable) so we delete it. | |
- name: Delete Previous Cache | |
if: ${{ steps.cache-restore.outputs.cache-hit }} | |
continue-on-error: true | |
run: | | |
gh extension install actions/gh-actions-cache | |
gh actions-cache delete "${{ env.cache-key }}" --confirm | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Saving the cache so that Fuzz testing can be additive to previous fuzz testing. | |
- name: Save Cache | |
uses: actions/cache/save@v3 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go-build }} | |
key: ${{ env.cache-key }} |