Skip to content

Commit

Permalink
workflows: add separate job for coverage
Browse files Browse the repository at this point in the history
Otherwise each of our test jobs uploads coverage profile to Codecov which
make zero sense and actually can lead to misleading results.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Apr 21, 2024
1 parent 8619325 commit f66a058
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
go: '1.20'
- os: macos-14
go: '1.21'
# Exclude latest Go version for Ubuntu as Coverage uses it.
- os: ubuntu-latest
go: '1.22'
steps:

- name: Setup go
Expand All @@ -53,6 +56,22 @@ jobs:
uses: actions/checkout@v4

- name: Tests
run: go test -race ./...

test:
name: Coverage
runs-on: ubuntu-latest
steps:

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Check out
uses: actions/checkout@v4

- name: Collect coverage
run: go test -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage results to Codecov
Expand Down

0 comments on commit f66a058

Please sign in to comment.