Skip to content

Commit ea26922

Browse files
authored
chore: add upload_coverage_report.yml (TheAlgorithms#697)
1 parent db7c875 commit ea26922

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: upload_coverage_report
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
11+
env:
12+
REPORT_NAME: "coverage.out"
13+
14+
jobs:
15+
upload_coverage_report:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '^1.18'
23+
- name: Generate code coverage
24+
run: |
25+
go test -coverprofile="${{ env.REPORT_NAME }}" ./...
26+
- name: Upload coverage to codecov
27+
uses: codecov/codecov-action@v3
28+
with:
29+
files: "${{ env.REPORT_NAME }}"
30+
fail_ci_if_error: true
31+
...

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/
22
.vscode/
3+
coverage.out

0 commit comments

Comments
 (0)