Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add code coverage #26

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
test:
Expand All @@ -25,5 +26,19 @@ jobs:
- name: setup tests
run: ./setup-test.sh

- name: Run tests
run: go test ./...
- name: Run tests and generate coverage report
run: |
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out -o coverage.txt
go tool cover -html=coverage.out -o coverage.html

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
name: codecov-umbrella
file: coverage.txt
fail_ci_if_error: true
slug: knbr13/gitcs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading