Skip to content

Commit

Permalink
Merge pull request #234 from mattfarina/cache-fuzz
Browse files Browse the repository at this point in the history
Add caching to fuzz testing
  • Loading branch information
mattfarina committed May 8, 2024
2 parents 4afef01 + 2a7536d commit 7a8e81a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/fuzz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,41 @@ on:
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 }}

0 comments on commit 7a8e81a

Please sign in to comment.