Skip to content

Commit 7fdb39c

Browse files
committed
Update codecov workflow to most recently recommended
1 parent 1af41df commit 7fdb39c

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
name: codecov
1+
name: Run tests and upload coverage
22

3-
on: [push, pull_request]
3+
on:
4+
push
45

56
jobs:
6-
run:
7-
strategy:
8-
matrix:
9-
os: [ ubuntu-latest, macos-latest ]
10-
go: [ 1.19.x ]
11-
runs-on: ${{ matrix.os }}
7+
test:
8+
name: Run tests and collect coverage
9+
runs-on: ubuntu-latest
1210
steps:
13-
- uses: actions/checkout@main
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 2
1415

15-
- name: Set up Go
16-
uses: actions/setup-go@v3
17-
with:
18-
go-version: ${{ matrix.go }}
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
1918

20-
- name: Generate Coverage Report
21-
run: go test ./... -coverprofile=coverage.txt -covermode=atomic
19+
- name: Install dependencies
20+
run: go mod download
2221

23-
- name: Upload Coverage Report to Codecov
24-
uses: codecov/codecov-action@v3
25-
with:
26-
file: ./coverage.txt
22+
- name: Run tests
23+
run: go test -coverprofile=coverage.txt
24+
25+
- name: Upload results to Codecov
26+
uses: codecov/codecov-action@v5
27+
with:
28+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)