Skip to content

Commit f888b80

Browse files
authored
Coverage badge fix (#65)
* added changes to get coverage badge working * updated readme for code coverage badge
1 parent 6e9cc0d commit f888b80

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ jobs:
4242
fi
4343
4444
- name: Validate black version
45-
# Fixed: Added space between --check and .
4645
run: black --version
4746

4847
- name: Check Formatting (Black)
49-
# Fixed: Added space between --check and .
5048
run: black --check .
5149

5250
- name: Run Linter (Flake8)
53-
# Fixed: Added space between flake8 and .
5451
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
5552

5653
tests:
@@ -78,10 +75,20 @@ jobs:
7875
- name: Install Dependencies
7976
run: |
8077
python -m pip install --upgrade pip
78+
# Ensure pytest-cov is installed
79+
pip install pytest pytest-cov
8180
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
8281
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
8382
pip install -e .
8483
8584
- name: Run Tests
85+
# MODIFIED: Added --cov flags to generate coverage data
8686
run: |
87-
python -m pytest --verbose
87+
python -m pytest --verbose --cov=./ --cov-report=xml
88+
89+
- name: Upload coverage to Codecov
90+
# NEW STEP: Uploads data to generate the badge
91+
uses: codecov/codecov-action@v5
92+
with:
93+
token: ${{ secrets.CODECOV_TOKEN }}
94+
fail_ci_if_error: true

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
uses: pypa/gh-action-pypi-publish@release/v1
3232
with:
3333
user: __token__
34-
password: ${{ secrets.PYPI_API_TOKEN }}
34+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![PyPI](https://img.shields.io/pypi/v/pyntm.svg)](https://pypi.python.org/pypi/pyNTM)
22
[![CI](https://github.com/tim-fiola/network_traffic_modeler_py3/actions/workflows/ci.yml/badge.svg)](https://github.com/tim-fiola/network_traffic_modeler_py3/actions/workflows/ci.yml)
3-
[![Coverage Status](https://coveralls.io/repos/github/tim-fiola/network_traffic_modeler_py3/badge.svg?branch=master)](https://coveralls.io/github/tim-fiola/network_traffic_modeler_py3?branch=master)
3+
[![codecov](https://codecov.io/gh/tim-fiola/network_traffic_modeler_py3/graph/badge.svg?token=YOUR_TOKEN_HERE)](https://codecov.io/gh/tim-fiola/network_traffic_modeler_py3)
44
[![Documentation Status](https://readthedocs.org/projects/pyntm/badge/?version=latest)](https://pyntm.readthedocs.io/en/latest/?badge=latest)
55

66

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
with open("requirements.txt", "r") as fs:
44
reqs = [r for r in fs.read().splitlines() if (len(r) > 0 and not r.startswith("#"))]
55

6-
version = "3.5.1"
6+
version = "4.0.1"
77

88
with open("README.md", "r") as fh:
99
long_description = fh.read()

0 commit comments

Comments
 (0)