From 17102e3b91a0eaa1415ee5d9222de11afea7a0dc Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Fri, 2 Sep 2022 17:25:16 +0100 Subject: [PATCH 1/3] fuzz: Ensure latest base images are used Latest base image should contain Go 1.18, removing the need of updating that ourselves, apart from benefiting from latest changes upstream. Signed-off-by: Paulo Gomes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 677e0573..ecbc4e2a 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,7 @@ fuzz-build: rm -rf $(BUILD_DIR)/fuzz/ mkdir -p $(BUILD_DIR)/fuzz/out/ - docker build . --tag local-fuzzing:latest -f tests/fuzz/Dockerfile.builder + docker build . --pull --tag local-fuzzing:latest -f tests/fuzz/Dockerfile.builder docker run --rm \ -e FUZZING_LANGUAGE=go -e SANITIZER=address \ -e CIFUZZ_DEBUG='True' -e OSS_FUZZ_PROJECT_NAME=fluxcd \ From b7f9239f9ac9ec91ac64c78c2ce45fa1c24e0a0d Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Fri, 2 Sep 2022 17:37:56 +0100 Subject: [PATCH 2/3] fuzz: Reuse go cache from host Signed-off-by: Paulo Gomes --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ecbc4e2a..a6835c87 100644 --- a/Makefile +++ b/Makefile @@ -172,6 +172,7 @@ fuzz-build: docker run --rm \ -e FUZZING_LANGUAGE=go -e SANITIZER=address \ -e CIFUZZ_DEBUG='True' -e OSS_FUZZ_PROJECT_NAME=fluxcd \ + -v "$(shell go env GOMODCACHE):/root/go/pkg/mod" \ -v "$(BUILD_DIR)/fuzz/out":/out \ local-fuzzing:latest From ce3d20141336bc6a287cfeb8f82aad031cd27c97 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Sat, 3 Sep 2022 03:55:29 +0100 Subject: [PATCH 3/3] fuzz: Use Go 1.18 on CI and fix cache path Signed-off-by: Paulo Gomes --- .github/workflows/cifuzz.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cifuzz.yaml b/.github/workflows/cifuzz.yaml index dfdafc64..aadacc09 100644 --- a/.github/workflows/cifuzz.yaml +++ b/.github/workflows/cifuzz.yaml @@ -13,12 +13,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: 1.18.x + - id: go-env + run: | + echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)" - name: Restore Go cache - uses: actions/cache@v1 + uses: actions/cache@v3 with: - path: /home/runner/work/_temp/_github_home/go/pkg/mod + path: ${{ steps.go-env.outputs.go-mod-cache }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go- + ${{ runner.os }}-go - name: Smoke test Fuzzers run: make fuzz-smoketest