-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (29 loc) · 916 Bytes
/
code-coverage.yaml
File metadata and controls
30 lines (29 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Code Coverage Workflow
on: [pull_request]
jobs:
codecov:
name: Codecov Workflow
runs-on: ubuntu-18.04
steps:
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: 3.7
- name: Generate coverage report
run: |
pip install pytest pytest-mock pytest-cov
pip install -r dependencies/requirements.txt
python -m pytest tests/ -v --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests