From fccc6cdb11ebf056702fe0d86cb9c782e83a2403 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 16 Jun 2025 17:40:37 +0200 Subject: [PATCH] generate test coverage in CI --- .github/workflows/ci.yaml | 14 +++++++++++++- Makefile | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 239a463dc..03e64dca2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,11 @@ name: CI -on: [pull_request, workflow_dispatch] +on: + pull_request: + workflow_dispatch: + push: + branches: + - main jobs: main: @@ -26,8 +31,15 @@ jobs: - name: Test run: make test + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: code-coverage + path: coverage.out + config: name: Check GoReleaser config + if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/Makefile b/Makefile index 171d9864d..a3b64bb3d 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ lint: lint-golangci-lint lint-yamllint # Test test: @echo ">> Running tests for the CLI application" - @go test ./... -count=1 + @go test ./... -count=1 -coverprofile=coverage.out # Test coverage coverage: