Skip to content

Commit

Permalink
chore: add upload_coverage_report.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 committed Jan 13, 2024
1 parent db7c875 commit 9d81f1d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/upload_coverage_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: upload_coverage_report

on:
workflow_dispatch:
push:
branches:
- master
pull_request:

env:
REPORT_NAME: "coverage.out"

jobs:
upload_coverage_report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.18'
- name: Generate code coverage
run: |
go test -coverprofile="${{ env.REPORT_NAME }}" ./...
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
files: "${{ env.REPORT_NAME }}"
fail_ci_if_error: true
...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
.vscode/
coverage.out

0 comments on commit 9d81f1d

Please sign in to comment.