From 1097636ea7d9cddf261d298b56274b9c851ce79c Mon Sep 17 00:00:00 2001 From: Alan Franzoni Date: Thu, 17 Mar 2022 14:37:13 +0100 Subject: [PATCH] Enable codecov for pghoard repository --- .github/workflows/build.yml | 7 ++++++- Makefile | 5 +++-- README.rst | 2 ++ codecov.yml | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceb52c01..3bd433b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,4 +81,9 @@ jobs: pip install -e . - id: unittest - run: make unittest + run: make coverage + + - id: upload-codecov + uses: codecov/codecov-action@v2 + with: + verbose: true diff --git a/Makefile b/Makefile index 8c6088a5..c4e18662 100644 --- a/Makefile +++ b/Makefile @@ -28,12 +28,13 @@ fmt: version .PHONY: coverage coverage: version - $(PYTHON) -m pytest $(PYTEST_ARG) --cov-report term-missing --cov pghoard test/ + $(PYTHON) -m pytest $(PYTEST_ARG) --cov-report term-missing --cov-report xml:coverage.xml \ + --cov pghoard test/ .PHONY: clean clean: $(RM) -r *.egg-info/ build/ dist/ rpm/ - $(RM) ../pghoard_* test-*.xml $(generated) + $(RM) ../pghoard_* test-*.xml coverage.xml $(generated) pghoard/version.py: version.py $(PYTHON) $^ $@ diff --git a/README.rst b/README.rst index 34fea83a..8052aebc 100644 --- a/README.rst +++ b/README.rst @@ -3,6 +3,8 @@ PGHoard |BuildStatus|_ .. |BuildStatus| image:: https://github.com/aiven/pghoard/actions/workflows/build.yml/badge.svg?branch=main .. _BuildStatus: https://github.com/aiven/pghoard/actions +.. image:: https://codecov.io/gh/aiven/pghoard/branch/main/graph/badge.svg?token=nLr7M7hvCx + :target: https://codecov.io/gh/aiven/pghoard ``pghoard`` is a PostgreSQLĀ® backup daemon and restore tooling that stores backup data in cloud object stores. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..dcbddf05 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +coverage: + status: + project: + default: + # basic + target: auto + threshold: 0% + base: auto + # advanced settings + branches: + - main + if_ci_failed: error #success, failure, error, ignore + informational: true + only_pulls: false +