From 7e8914ad3d1626348a9ee1df4d4b7f5785bfb94f Mon Sep 17 00:00:00 2001 From: Artem Malyshev Date: Sun, 18 Aug 2019 02:15:31 +0300 Subject: [PATCH] Setup codecov (#37) * Report coverage to the Codecov service even if the build failed. * Setup Codecov README and documentation badges. * Setup target coverage. --- README.md | 3 ++- azure-pipelines.yml | 12 ++++-------- codecov.yml | 10 ++++++++++ docs/index.md | 3 ++- 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 codecov.yml diff --git a/README.md b/README.md index 24dc3ad..aec65af 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Mappers](https://raw.githubusercontent.com/dry-python/brand/master/logo/mappers.png)](https://github.com/dry-python/mappers) -[![Build Status](https://dev.azure.com/dry-python/mappers/_apis/build/status/dry-python.mappers?branchName=master)](https://dev.azure.com/dry-python/mappers/_build/latest?definitionId=1&branchName=master) +[![azure-pipeline](https://dev.azure.com/dry-python/mappers/_apis/build/status/dry-python.mappers?branchName=master)](https://dev.azure.com/dry-python/mappers/_build/latest?definitionId=1&branchName=master) +[![codecov](https://codecov.io/gh/dry-python/mappers/branch/master/graph/badge.svg)](https://codecov.io/gh/dry-python/mappers) ----- diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e2f1440..7976360 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -81,7 +81,7 @@ jobs: inputs: versionSpec: $(python.version) displayName: Install Python. - - script: pip install --upgrade tox + - script: pip install --upgrade tox codecov displayName: Install Tox. - task: NodeTool@0 inputs: @@ -91,14 +91,10 @@ jobs: - script: tox -e $(tox.env) displayName: Run Tox. - script: | - if [ ! -f .coverage ]; then - echo No coverage data found. - exit 0 + if [ -f .coverage ] + then + codecov fi - PATH=$HOME/.local/bin:$PATH - python$(python.version) -m pip install --user codecov - codecov env: CODECOV_TOKEN: $(codecov.token) - condition: succeeded() displayName: Report Coverage. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..14000d8 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +--- +comment: false +coverage: + status: + project: + default: + target: 95% + patch: + default: + target: 100% diff --git a/docs/index.md b/docs/index.md index 20a1926..99c16a0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,7 @@ [![Mappers](https://raw.githubusercontent.com/dry-python/brand/master/logo/mappers.png)](https://github.com/dry-python/mappers) -[![Build Status](https://dev.azure.com/dry-python/mappers/_apis/build/status/dry-python.mappers?branchName=master)](https://dev.azure.com/dry-python/mappers/_build/latest?definitionId=1&branchName=master) +[![azure-pipeline](https://dev.azure.com/dry-python/mappers/_apis/build/status/dry-python.mappers?branchName=master)](https://dev.azure.com/dry-python/mappers/_build/latest?definitionId=1&branchName=master) +[![codecov](https://codecov.io/gh/dry-python/mappers/branch/master/graph/badge.svg)](https://codecov.io/gh/dry-python/mappers) -----