Skip to content

Commit

Permalink
Add coverage + codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantv committed Jan 14, 2025
1 parent 3f570c1 commit 69fddd3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,22 @@ jobs:
run: mise run test

- name: Verify golden files
if: env.GO_NOT_LATEST == 'false'
if: env.MISE_ENV == 'stable'
run: make diff-testdata

## Generate coverage for CodeCov
- name: Generate coverage
run: mise run cover

- name: Upload to CodeCov
uses: codecov/codecov-action@v5
with:
disable_search: true
files: ./cover.out
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


lint:
name: lint
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ run = "go build ./..."
description = "Run Go tests"
run = "go test ./..."

[tasks.cover]
description = "Run Go tests with coverage"
run = "go test -coverprofile cover.out ./..."

[tasks.lint]
description = "Run golangci-lint"
run = "golangci-lint run ./..."
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# faket [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci]
# faket [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage][codecov-img]][codecov]


Are your test helpers correct -- test them with `faket`.

Expand Down Expand Up @@ -71,3 +72,5 @@ This library is still in development, and is not API stable.
[doc]: https://pkg.go.dev/github.com/prashantv/faket
[ci-img]: https://github.com/prashantv/faket/actions/workflows/go.yml/badge.svg
[ci]: https://github.com/prashantv/faket/actions/workflows/go.yml
[codecov-img]: https://codecov.io/github/prashantv/faket/graph/badge.svg?token=RUXXMHOX4Q
[codecov]: https://codecov.io/github/prashantv/faket
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comment: false
ignore:
# test runner logic for integration tests against stdlib
- 'internal/cmptest/*.go'

0 comments on commit 69fddd3

Please sign in to comment.