Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a fuzzing workflow to github actions #2038

Merged
merged 2 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on: [push, pull_request]
Expand All @@ -6,6 +7,9 @@ jobs:
test:
name: Go ${{ matrix.go-version }} with Kafka ${{ matrix.kafka-version }} on Ubuntu
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
Expand All @@ -15,6 +19,7 @@ jobs:

env:
DEBUG: true
GOFLAGS: -trimpath
KAFKA_VERSION: ${{ matrix.kafka-version }}

steps:
Expand All @@ -25,9 +30,18 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v2
- 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: ~/go/pkg/mod
path: |
${{ steps.go-env.outputs.cache }}
${{ steps.go-env.outputs.modcache }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Fuzzing

on: [push, pull_request]

jobs:
test:
name: Fuzz
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

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 ./...