Skip to content

Commit 01a1242

Browse files
authored
DEV: Show code coverage (#754)
1 parent 0500c8d commit 01a1242

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ on:
1010
branches: [ main ]
1111

1212
jobs:
13-
build:
14-
13+
tests:
1514
runs-on: ubuntu-latest
1615
strategy:
1716
matrix:
1817
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
1918

2019
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-python@v3
2422
with:
2523
python-version: ${{ matrix.python-version }}
2624

@@ -48,4 +46,25 @@ jobs:
4846

4947
- name: Test with pytest
5048
run: |
51-
pytest Tests --cov --cov-report term-missing -vv
49+
pytest Tests --cov --cov-report term-missing --cov-report xml -vv
50+
51+
- name: Upload Coverage to Codecov
52+
uses: codecov/codecov-action@v2
53+
with:
54+
files: ./coverage.xml
55+
package:
56+
name: Build & verify package
57+
runs-on: ubuntu-latest
58+
59+
steps:
60+
- uses: actions/checkout@v3
61+
- uses: actions/setup-python@v3
62+
with:
63+
python-version: ${{env.PYTHON_LATEST}}
64+
65+
- run: python -m pip install build twine check-wheel-contents
66+
- run: python -m build --sdist --wheel .
67+
- run: ls -l dist
68+
- run: check-wheel-contents dist/*.whl
69+
- name: Check long_description
70+
run: python -m twine check dist/*

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
.tox
55
build
66
.idea/*
7-
.coverage
87
*.egg-info/
98
dist/*
109

10+
# Code coverage artifacts
11+
.coverage
12+
coverage.xml
13+
1114
# Editors / IDEs
1215
.vscode/
1316

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[![Python Support](https://img.shields.io/pypi/pyversions/PyPDF2.svg)](https://pypi.org/project/PyPDF2/)
33
[![](https://img.shields.io/badge/-documentation-green)](https://pypdf2.readthedocs.io/en/latest/)
44
![GitHub last commit](https://img.shields.io/github/last-commit/py-pdf/PyPDF2)
5+
[![codecov](https://codecov.io/gh/py-pdf/PyPDF2/branch/master/graph/badge.svg?token=id42cGNZ5Z)](https://codecov.io/gh/py-pdf/PyPDF2)
56

67
# PyPDF2
78

0 commit comments

Comments
 (0)