From 288a093c55807f20dd915f44ce6d0fbc68b26732 Mon Sep 17 00:00:00 2001 From: Arjen de Rijke Date: Sun, 10 Dec 2023 11:45:23 +0100 Subject: [PATCH] Add code coverage (#11) * Fix macos workflow * Now the macos and linux workflows are the same * Add the staticcheck action on linux * Mark all issues found by the static checker * Add the reason everywhere, because it is mandatory * add go test coverage * test different threshold * Lower threshold again --- .github/workflows/go.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 843d064..da83c8e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,7 +26,23 @@ jobs: uses: dominikh/staticcheck-action@v1.3.0 with: version: "2023.1.6" - + + - name: Go test coverage + uses: gwatts/go-coverage-action@v1 + id: coverage + with: + # Optional coverage threshold + # use fail-coverage to determine what should happen below this threshold + coverage-threshold: 25 + + # collect coverage for all packages beyond the one under test + cover-pkg: ./... + + # Ignore code-generated files when calculating coverage totals + ignore-pattern: | + \.pb\.go$ + \_string\.go$ + - name: Build run: go build -v ./...