From 5fc60fb2f573ebea40124e2213e36a13b5ea3507 Mon Sep 17 00:00:00 2001 From: Vasiliy Vasilyuk Date: Mon, 10 Jul 2023 23:21:09 +0300 Subject: [PATCH] Add coverage report by Codecov This is needed to display coverage, and as an example of setting up coverage counts. Also, added badges to make the repositories look prettier. --- .github/workflows/go.yml | 5 +++++ README.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5b3a76a..5d26b60 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -34,6 +34,11 @@ jobs: - name: Teardown test environment run: make test-env-up + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + golangci: name: lint runs-on: ubuntu-latest diff --git a/README.md b/README.md index 1915446..8b79074 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Example of testing Go code with Postgres +[![Go workflow status badge](https://github.com/xorcare/testing-go-code-with-postgres/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/xorcare/testing-go-code-with-postgres/actions/workflows/go.yml) +[![codecov](https://codecov.io/github/xorcare/testing-go-code-with-postgres/branch/main/graph/badge.svg?token=AmPmVHf2ej)](https://codecov.io/github/xorcare/testing-go-code-with-postgres/tree/main) +[![Go Report Card](https://goreportcard.com/badge/github.com/xorcare/testing-go-code-with-postgres)](https://goreportcard.com/report/github.com/xorcare/testing-go-code-with-postgres) + The example suggests a solution to the problem of cleaning the database after running tests and the problem of running tests in parallel. It also shows how to organize integration testing of Go code with Postgres.