Skip to content

Commit 8493e9d

Browse files
authored
Add codecov GitHub Action (#355)
1 parent 314ea0c commit 8493e9d

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Codecov
2+
on: [push]
3+
jobs:
4+
run:
5+
runs-on: ${{ matrix.os }}
6+
strategy:
7+
matrix:
8+
os: [ubuntu-latest, macos-latest]
9+
env:
10+
OS: ${{ matrix.os }}
11+
PYTHON: '3.7'
12+
steps:
13+
- uses: actions/checkout@master
14+
- name: Setup Python
15+
uses: actions/setup-python@master
16+
with:
17+
python-version: 3.7
18+
- name: Generate coverage report
19+
run: |
20+
python3 -m pip install -U -r dev-requirements.txt
21+
pytest --cov=tests/ --cov-report=xml
22+
- name: Upload coverage to Codecov
23+
uses: codecov/codecov-action@v1
24+
with:
25+
token: ${{ secrets.CODECOV_TOKEN }}
26+
file: ./coverage.xml
27+
flags: unittests
28+
env_vars: OS,PYTHON
29+
name: codecov-umbrella
30+
fail_ci_if_error: true

codecov.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
9+
parsers:
10+
gcov:
11+
branch_detection:
12+
conditional: yes
13+
loop: yes
14+
method: no
15+
macro: no
16+
17+
comment:
18+
layout: "reach,diff,flags,tree"
19+
behavior: default
20+
require_changes: no

dev-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ coverage
33
pytest==5.4.3
44
pytest-asyncio==0.14.0
55
pytest-aiohttp==0.3.0
6+
pytest-cov==2.10.0
7+
codecov==2.1.7

0 commit comments

Comments
 (0)