Skip to content

Commit fd7918e

Browse files
committed
Add a workflow to measure coverage on pushes to master
1 parent d6a0aad commit fd7918e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Based on
2+
# python-package.yml
3+
# and
4+
# https://medium.com/@wkrzywiec/how-to-write-good-quality-python-code-with-github-actions-2f635a2ab09a
5+
6+
name: Coverage
7+
8+
on:
9+
push:
10+
branches: [ master ]
11+
12+
jobs:
13+
codecov:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Generate coverage report
32+
run: |
33+
pip install coverage
34+
coverage run --source=. -m runtests
35+
coverage xml
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v1
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
file: ./coverage.xml
41+
flags: unittests

0 commit comments

Comments
 (0)