File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 9
9
jobs :
10
10
test :
11
11
runs-on : ubuntu-latest
12
+ env :
13
+ cache-key : fuzzing
12
14
steps :
13
15
- name : Install Go
14
16
uses : actions/setup-go@v5
15
17
with :
16
18
go-version : " 1.22"
19
+ # The cache path may be different on different runners. GitHub may change
20
+ # this in the future. So, we dynamically fetch it.
21
+ - name : Get Go Cache Paths
22
+ id : go-cache-paths
23
+ run : |
24
+ echo "::set-output name=go-build::$(go env GOCACHE)"
17
25
- name : Checkout code
18
26
uses : actions/checkout@v4
27
+ - name : Restore Cache
28
+ id : cache-restore
29
+ uses : actions/cache/restore@v3
30
+ with :
31
+ path : ${{ steps.go-cache-paths.outputs.go-build }}
32
+ key : ${{ env.cache-key }}
19
33
- name : Fuzz
20
34
run : make fuzz
35
+ # Cannot overwrite the existing cache (id's are immutable) so we delete it.
36
+ - name : Delete Previous Cache
37
+ if : ${{ steps.cache-restore.outputs.cache-hit }}
38
+ continue-on-error : true
39
+ run : |
40
+ gh extension install actions/gh-actions-cache
41
+ gh actions-cache delete "${{ env.cache-key }}" --confirm
42
+ env :
43
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
+ # Saving the cache so that Fuzz testing can be additive to previous fuzz testing.
45
+ - name : Save Cache
46
+ uses : actions/cache/save@v3
47
+ with :
48
+ path : ${{ steps.go-cache-paths.outputs.go-build }}
49
+ key : ${{ env.cache-key }}
You can’t perform that action at this time.
0 commit comments