Skip to content

Commit 6a560d9

Browse files
authored
Merge pull request #886 from pjbgf/fuzz-update
fuzz: Fuzz optimisations
2 parents 6d479e5 + 976f4bb commit 6a560d9

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.github/workflows/cifuzz.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ jobs:
2121
uses: actions/setup-go@v3
2222
with:
2323
go-version: 1.18.x
24+
- id: go-env
25+
run: |
26+
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"
2427
- name: Restore Go cache
2528
uses: actions/cache@v3
2629
with:
27-
path: /home/runner/work/_temp/_github_home/go/pkg/mod
30+
path: ${{ steps.go-env.outputs.go-mod-cache }}
2831
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
2932
restore-keys: |
30-
${{ runner.os }}-go-
33+
${{ runner.os }}-go
3134
- name: Smoke test Fuzzers
3235
run: make fuzz-smoketest

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ fuzz-build: $(LIBGIT2)
234234
rm -rf $(BUILD_DIR)/fuzz/
235235
mkdir -p $(BUILD_DIR)/fuzz/out/
236236

237-
docker build . --tag local-fuzzing:latest -f tests/fuzz/Dockerfile.builder
237+
docker build . --pull --tag local-fuzzing:latest -f tests/fuzz/Dockerfile.builder
238238
docker run --rm \
239239
-e FUZZING_LANGUAGE=go -e SANITIZER=address \
240240
-e CIFUZZ_DEBUG='True' -e OSS_FUZZ_PROJECT_NAME=fluxcd \
@@ -244,6 +244,7 @@ fuzz-build: $(LIBGIT2)
244244
fuzz-smoketest: fuzz-build
245245
docker run --rm \
246246
-v "$(BUILD_DIR)/fuzz/out":/out \
247+
-v "$(shell go env GOMODCACHE):/root/go/pkg/mod" \
247248
-v "$(shell pwd)/tests/fuzz/oss_fuzz_run.sh":/runner.sh \
248249
local-fuzzing:latest \
249250
bash -c "/runner.sh"

tests/fuzz/Dockerfile.builder

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
FROM golang:1.18 AS go
2-
3-
FROM gcr.io/oss-fuzz-base/base-builder-go
4-
5-
# ensures golang 1.18 to enable go native fuzzing.
6-
COPY --from=go /usr/local/go /usr/local/
1+
FROM gcr.io/oss-fuzz-base/base-builder-go-codeintelligencetesting
72

83
COPY ./ $GOPATH/src/github.com/fluxcd/source-controller/
94
COPY ./tests/fuzz/oss_fuzz_build.sh $SRC/build.sh

0 commit comments

Comments
 (0)