diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3835283..f933828 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,14 @@ jobs: with: go-version: ${{ matrix.go }} - name: Test - run: go test -v -race ./... + run: go test -v -race -coverprofile=coverage.out ./... + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + with: + files: ./coverage.out + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} lint: name: Lint diff --git a/.gitignore b/.gitignore index 884f556..a726663 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ github-discover dist/ .DS_Store demo/node_modules/ +coverage.out diff --git a/README.md b/README.md index 7995314..3f9ad13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # github-discover [![CI](https://github.com/atani/github-discover/actions/workflows/ci.yml/badge.svg)](https://github.com/atani/github-discover/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/atani/github-discover/branch/main/graph/badge.svg)](https://codecov.io/gh/atani/github-discover) [![Go Report Card](https://goreportcard.com/badge/github.com/atani/github-discover)](https://goreportcard.com/report/github.com/atani/github-discover) [![Go Reference](https://pkg.go.dev/badge/github.com/atani/github-discover.svg)](https://pkg.go.dev/github.com/atani/github-discover) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)