diff --git a/.github/workflows/fuzz-test.yml b/.github/workflows/fuzz-test.yml index 902e12d..390e0a2 100644 --- a/.github/workflows/fuzz-test.yml +++ b/.github/workflows/fuzz-test.yml @@ -142,11 +142,25 @@ jobs: -fuzzminimizetime='${{ env.FUZZ_MINIMIZE_TIME }}' ${{ matrix.package }} - - name: Upload failed corpus + name: Archive failed cases + if: ${{ failure() }} + run: | + tar czf fuzzcase.tgz $(find "${{ matrix.package }}/testdata/fuzz" -type f) + - + name: Upload failed cases if: ${{ failure() }} uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 # TODO(fredbi): ideally, after uploading, we should fire a pull request to add # this corpus to testdata. + with: + path: fuzzcase.tgz + name: '${{ runner.os }}-fuzz-corpus-failure' + retention-days: 60 + - + name: Upload failed corpus + # This is the current corpus, it does not contain the latest failed case + if: ${{ failure() }} + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: path: ${{ env.CORPUS_DIR }} name: '${{ runner.os }}-fuzz-corpus-failure' diff --git a/.github/workflows/go-test-monorepo.yml b/.github/workflows/go-test-monorepo.yml index 85bb626..a1aa4b3 100644 --- a/.github/workflows/go-test-monorepo.yml +++ b/.github/workflows/go-test-monorepo.yml @@ -6,6 +6,11 @@ permissions: on: workflow_call: + inputs: + extra-flags: + description: extra flags to add to go test + type: string + required: false defaults: run: @@ -115,6 +120,8 @@ jobs: # This requires: # * go.work properly initialized with use of all known modules # * go.work committed to git + env: + EXTRA_FLAGS: ${{ inputs.extra-flags }} run: > gotestsum --jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' @@ -126,6 +133,7 @@ jobs: -timeout=20m -coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' -covermode=atomic + -coverpkg="$(go list)"/... ${EXTRA_FLAGS} ./... - name: Run unit tests on all modules ( gotestsum --jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' @@ -161,7 +174,7 @@ jobs: -timeout=20m -coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' -covermode=atomic - -coverpkg="$(go list)"/... + -coverpkg="$(go list)"/... ${EXTRA_FLAGS} ./... - name: Upload coverage artifacts diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 5e2d8f1..15ce1f7 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -6,6 +6,11 @@ permissions: on: workflow_call: + inputs: + extra-flags: + description: extra flags to add to go test + type: string + required: false defaults: run: @@ -66,6 +71,8 @@ jobs: echo "TMP=${TMP}" >> "${GITHUB_ENV}" - name: Run unit tests + env: + EXTRA_FLAGS: ${{ inputs.extra-flags }} run: > gotestsum --jsonfile 'unit.report.${{ matrix.os }}-${{ matrix.go }}.json' @@ -76,7 +83,7 @@ jobs: -timeout=20m -coverprofile='unit.coverage.${{ matrix.os }}-${{ matrix.go }}.out' -covermode=atomic - -coverpkg="$(go list)"/... + -coverpkg="$(go list)"/... ${EXTRA_FLAGS} ./... - name: Upload coverage artifacts