11#! /bin/bash
22set -xe
33
4- # go-fuzz doesn't support modules yet, so ensure we do everything
5- # in the old style GOPATH way
6- export GO111MODULE=" off"
7-
84# install go-fuzz
95go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
106
7+ # This is current workaround to support go modules
8+ cd $GOPATH /src/github.com/dvyukov/go-fuzz/go-fuzz
9+ git remote add fork https://github.com/fuzzitdev/go-fuzz
10+ git fetch
11+ git checkout fork
12+ go install ./...
13+
1114# TODO: needed until https://github.com/actions/setup-go/issues/14 is fixed
1215# adds GOBIN to PATH so that go-fuzz-build is visible
1316GOB=" $( go env GOPATH) /bin"
@@ -16,26 +19,15 @@ PATH=${PATH}:"${GOB}"
1619# target name can only contain lower-case letters (a-z), digits (0-9) and a dash (-)
1720# to add another target, make sure to create it with `fuzzit create target`
1821# before using `fuzzit create job`
19- TARGET=micro-starter-kit
20-
22+ TARGET=crypto
23+ cd ./shared/crypto
2124go-fuzz-build -libfuzzer -o ${TARGET} .a .
2225clang -fsanitize=fuzzer ${TARGET} .a -o ${TARGET}
2326
2427# install fuzzit for talking to fuzzit.dev service
2528# or latest version:
2629# https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64
27- wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.35 /fuzzit_Linux_x86_64
30+ wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.54 /fuzzit_Linux_x86_64
2831chmod a+x ./fuzzit
2932
30- # upload fuzz target for long fuzz testing on fuzzit.dev server
31- # or run locally for regression
32- if [ " ${GITHUB_EVENT_NAME} " == " push" ]; then
33- TYPE=fuzzing
34- elif [ " ${GITHUB_EVENT_NAME} " == " pull_request" ]; then
35- TYPE=local-regression
36- else
37- echo " Unexpected event '${GITHUB_EVENT_NAME} '"
38- exit 1
39- fi
40-
41- ./fuzzit create job --type $TYPE kkowalczyk/${TARGET} ${TARGET}
33+ ./fuzzit create job --type $1 m-starter-kit/${TARGET} ${TARGET}
0 commit comments