From 4ec7291b8d9c8dace873cba866a3e01a1e3f6dd9 Mon Sep 17 00:00:00 2001 From: Bernd Warmuth Date: Mon, 25 Nov 2024 14:57:34 +0100 Subject: [PATCH] chore: write test cov results to separate files Write test reports to separate files and upload them separately Signed-off-by: Bernd Warmuth --- .github/workflows/pr-checks.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 06c9342..be53f23 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -54,13 +54,24 @@ jobs: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - name: Run unit tests - run: go test -race -coverprofile=coverage.out -covermode=atomic ./... + run: go test -race -coverpkg=./... -coverprofile=coverage-unit.out -covermode=atomic ./... - name: Run e2e tests - run: go test -race --coverprofile=coverage.out -covermode=atomic ./e2e/... - - name: Upload coverage to Codecov + run: go test -race -coverpkg=./... -coverprofile=coverage-e2e.out -covermode=atomic ./e2e/... + - name: Upload coverage to Codecov (unit) uses: codecov/codecov-action@v4.6.0 with: - name: Code Coverage for GO SDK + name: Code Coverage for GO SDK (unit) + files: ./coverage-unit.out + flags: unit + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} + - name: Upload coverage to Codecov (e2e) + uses: codecov/codecov-action@v4.6.0 + with: + name: Code Coverage for GO SDK (e2e) + files: ./coverage-e2e.out + flags: e2e fail_ci_if_error: true verbose: true token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}