Skip to content

Commit f7bd9df

Browse files
codecov setup
1 parent 6338e05 commit f7bd9df

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
name: CI
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
88

99
jobs:
10-
test:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v3
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
1414

15-
- name: Set up Go
16-
uses: actions/setup-go@v4
17-
with:
18-
go-version: '1.21'
15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.21'
1919

20-
- name: Check format
21-
run: |
22-
if [ -n "$(gofmt -l .)" ]; then
23-
echo "Files not properly formatted:"
24-
gofmt -l .
25-
exit 1
26-
fi
20+
- name: Check format
21+
run: |
22+
if [ -n "$(gofmt -l .)" ]; then
23+
echo "Files not properly formatted:"
24+
gofmt -l .
25+
exit 1
26+
fi
2727
28-
- name: Test
29-
run: |
30-
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
28+
- name: Run Tests with Coverage
29+
run: |
30+
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
3131
32-
- name: Upload coverage
33-
uses: codecov/codecov-action@v3
34-
with:
35-
file: ./coverage.txt
32+
- name: Upload coverage reports to Codecov
33+
uses: codecov/codecov-action@v3
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
files: ./coverage.txt
37+
fail_ci_if_error: true
38+
verbose: true

0 commit comments

Comments
 (0)