Skip to content

Commit

Permalink
Add go-fuzz to all exportable Funcs (#31)
Browse files Browse the repository at this point in the history
* Initial Fuzzing Logic
* Add more fuzzing, add gitignore, add cleanup, gomod updates
* Exclude fuzz directories from commits
* Update docs on Fuzzing
* Update docs with Examples and Offline Mode
* Remove duplicate line in Makefile
  • Loading branch information
eduncan911 authored Feb 13, 2020
1 parent 8139fb1 commit 975adb8
Show file tree
Hide file tree
Showing 8 changed files with 968 additions and 30 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/go-cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: go-cicd

jobs:

golangci-lint:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -16,20 +16,21 @@ jobs:
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
echo "::add-path::${{ github.workspace }}/go/bin"
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 1
path: podcast/go/src/github.com/${{ github.repository }}
path: go/src/github.com/${{ github.repository }}
- name: Install golangci-lint
shell: bash
run: |
go get github.com/golangci/golangci-lint/cmd/golangci-lint
- name: Run linters
shell: bash
run: |
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
golangci-lint -E bodyclose,misspell,gocyclo,dupl,gofmt,golint,unconvert,depguard,interfacer run
coveralls:
coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand Down Expand Up @@ -62,7 +63,9 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov

go-bench:
benchmark:
# TODO: actually compare to previous runs
# maybe this setup: https://github.com/knqyf263/cob
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -75,13 +78,14 @@ jobs:
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
echo "::add-path::${{ github.workspace }}/go/bin"
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 1
path: podcast/go/src/github.com/${{ github.repository }}
path: go/src/github.com/${{ github.repository }}
- name: Run Benchmark
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
go test -test.run Benchmark -cpu 1 -bench .
go-test:
Expand All @@ -102,10 +106,12 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 1
path: podcast/go/src/github.com/${{ github.repository }}
path: go/src/github.com/${{ github.repository }}
- name: Run tests
shell: bash
run: |
cd $GOPATH/src/github.com/${{ github.repository }}
go test -v -covermode=count
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
profile.out
README.md.tmp

corpus
crashers
suppressions
workdir
podcast-fuzz.zip
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ SHELL = /bin/bash
GITHUB_REPO:=eduncan911/podcast

README:
godoc2ghmd github.com/$(GITHUB_REPO) > README.md.tmp
godoc2ghmd -play -ex -verify_import_links=0 github.com/$(GITHUB_REPO) > README.md.tmp
echo "[![GoDoc](https://godoc.org/github.com/$(GITHUB_REPO)?status.svg)](https://godoc.org/github.com/$(GITHUB_REPO))" > README.md
echo "[![Build Status](https://github.com/$(GITHUB_REPO)/workflows/go-cicd/badge.svg)](https://github.com/$(GITHUB_REPO)/actions?workflow=go-cicd)" >> README.md
echo "[![Coverage Status](https://coveralls.io/repos/github/$(GITHUB_REPO)/badge.svg?branch=master)](https://coveralls.io/github/$(GITHUB_REPO)?branch=master)" >> README.md
echo "[![Go Report Card](https://goreportcard.com/badge/github.com/$(GITHUB_REPO))](https://goreportcard.com/report/github.com/$(GITHUB_REPO))" >> README.md
echo "[![GoDoc](https://godoc.org/github.com/$(GITHUB_REPO)?status.svg)](https://godoc.org/github.com/$(GITHUB_REPO))"
echo "[![MIT License](https://img.shields.io/npm/l/mediaelement.svg)](https://eduncan911.mit-license.org/)" >> README.md
echo >>README.md
cat README.md.tmp >> README.md
rm README.md.tmp

clean:
rm -rf corpus crashers suppressions workdir podcast-fuzz.zip
Loading

0 comments on commit 975adb8

Please sign in to comment.