Skip to content

Commit 96d86ba

Browse files
authored
chore: fix coverage uploads to Codecov (#306)
chore: write test cov results to separate files Write test reports to separate files and upload them separately Signed-off-by: Bernd Warmuth <[email protected]>
1 parent 510b2a6 commit 96d86ba

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/pr-checks.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,24 @@ jobs:
5454
path: ~/go/pkg/mod
5555
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
5656
- name: Run unit tests
57-
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
57+
run: go test -race -short -coverpkg=./... -coverprofile=coverage-unit.out -covermode=atomic ./...
5858
- name: Run e2e tests
59-
run: go test -race --coverprofile=coverage.out -covermode=atomic ./e2e/...
60-
- name: Upload coverage to Codecov
59+
run: go test -race -coverpkg=./... -coverprofile=coverage-e2e.out -covermode=atomic ./e2e/...
60+
- name: Upload coverage to Codecov (unit)
6161
uses: codecov/[email protected]
6262
with:
63-
name: Code Coverage for GO SDK
63+
name: Code Coverage for GO SDK (unit)
64+
files: ./coverage-unit.out
65+
flags: unit
66+
fail_ci_if_error: true
67+
verbose: true
68+
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
69+
- name: Upload coverage to Codecov (e2e)
70+
uses: codecov/[email protected]
71+
with:
72+
name: Code Coverage for GO SDK (e2e)
73+
files: ./coverage-e2e.out
74+
flags: e2e
6475
fail_ci_if_error: true
6576
verbose: true
6677
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)