From a2266027a4dce684f9c40eba70da60ea3e41c604 Mon Sep 17 00:00:00 2001 From: Emmanuel Gautier Date: Sun, 31 May 2026 19:33:43 +0200 Subject: [PATCH] feat: add input to exclude some path from go test coverage --- actions/go-build-test/action.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/actions/go-build-test/action.yml b/actions/go-build-test/action.yml index 41b2af4..b301d9b 100644 --- a/actions/go-build-test/action.yml +++ b/actions/go-build-test/action.yml @@ -9,6 +9,10 @@ inputs: codecov-token: description: "Codecov token for uploading coverage reports" required: true + exclude: + description: "Packages to exclude (regex for grep -vE)" + required: false + default: "" runs: using: composite @@ -27,7 +31,14 @@ runs: - name: Test shell: bash - run: go test -coverprofile=coverage.out -covermode=atomic ./... + env: + EXCLUDE: ${{ inputs.exclude }} + run: | + if [ -z "$EXCLUDE" ]; then + go test -coverprofile=coverage.out -covermode=atomic ./... + else + go test -coverprofile=coverage.out -covermode=atomic $(go list ./... | grep -vE "$EXCLUDE") + fi - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v6