forked from IBM/sarama
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a fuzzing workflow to github actions
Currently this won't actually run anything, because we haven't written any fuzz tests, but it sets up the framework for running the built-in Go fuzzer against any tests that do get added
- Loading branch information
Showing
2 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: Fuzzing | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Fuzz | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GOFLAGS: -trimpath | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
|
||
- name: Get Go environment | ||
id: go-env | ||
run: | | ||
echo "::set-output name=cache::$(go env GOCACHE)" | ||
echo "::set-output name=modcache::$(go env GOMODCACHE)" | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
${{ steps.go-env.outputs.cache }} | ||
${{ steps.go-env.outputs.modcache }} | ||
key: fuzz-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
fuzz-go- | ||
- name: Build Go tip | ||
run: go install golang.org/dl/gotip@latest && gotip download | ||
|
||
- name: Run any fuzzing tests | ||
run: gotip test -v -run=^Fuzz -test.fuzztime=5m ./... |