From ecef20b53b1e1d2c037074aad386e2d64ec9c7be Mon Sep 17 00:00:00 2001 From: pilinux Date: Mon, 2 Jan 2023 15:12:22 +0100 Subject: [PATCH] Chore: added code coverage report --- .github/workflows/go.yml | 5 ++++- .gitignore | 1 + README.md | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8e02300..5e14763 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -29,4 +29,7 @@ jobs: STRIPE_WH: ${{ secrets.STRIPE_WH }} CURRENCY: ${{ secrets.CURRENCY }} DESTINATION: ${{ secrets.DESTINATION }} - run: go test -v -cover ./... + run: go test -v -cover -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage to Codecov + run: bash <(curl -s https://codecov.io/bash) diff --git a/.gitignore b/.gitignore index 4c49bd7..87a669b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .env +coverage.txt diff --git a/README.md b/README.md index 84cab93..f5bd033 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ ![Go][02] ![Linter][03] [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)][04] +[![Codecov][05]][06] +[![Go Reference][07]][08] Made stripe integration easy based on the official [Stripe Go](https://github.com/stripe/stripe-go/) client library. @@ -55,3 +57,7 @@ Please check the test files. [02]: https://github.com/pilinux/stripego/actions/workflows/go.yml/badge.svg [03]: https://github.com/pilinux/stripego/actions/workflows/golangci-lint.yml/badge.svg [04]: LICENSE +[05]: https://codecov.io/gh/pilinux/stripego/branch/main/graph/badge.svg?token=83H0G5TRH7 +[06]: https://codecov.io/gh/pilinux/stripego +[07]: https://pkg.go.dev/badge/github.com/pilinux/stripego +[08]: https://pkg.go.dev/github.com/pilinux/stripego