Skip to content

Commit

Permalink
Setup codecov (#37)
Browse files Browse the repository at this point in the history
* Report coverage to the Codecov service even if the build failed.

* Setup Codecov README and documentation badges.

* Setup target coverage.
  • Loading branch information
proofit404 authored Aug 17, 2019
1 parent 8e543a3 commit 7e8914a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

-----

Expand Down
12 changes: 4 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
comment: false
coverage:
status:
project:
default:
target: 95%
patch:
default:
target: 100%
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -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)

-----

Expand Down

0 comments on commit 7e8914a

Please sign in to comment.