Skip to content

Commit

Permalink
Added test coverage report + code coverage tracking + README badge
Browse files Browse the repository at this point in the history
  • Loading branch information
matagus committed Feb 8, 2024
1 parent 8502601 commit d9c858a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[report]
show_missing = True
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Run tests for Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} on ${{ matrix.os }}
- name: Run tests for Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} on ${{ matrix.os }} with coverage report
run: |
hatch run test.py${{ matrix.python-version }}-${{ matrix.django-version }}:test
hatch run test.py${{ matrix.python-version }}-${{ matrix.django-version }}:cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ django_generic_links.egg-info/
generic_links.egg-info/
.tox
.coverage
coverage.*
project/
htmlcov/
db.sqlite3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-generic-links
====================

![Python Compatibility](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg) [![PyPi Version](https://img.shields.io/pypi/v/django-generic-links.svg)](https://pypi.python.org/pypi/django-generic-links) ![CI badge](https://github.com/matagus/django-generic-links/actions/workflows/ci.yml/badge.svg) [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
![Python Compatibility](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg) [![PyPi Version](https://img.shields.io/pypi/v/django-generic-links.svg)](https://pypi.python.org/pypi/django-generic-links) ![CI badge](https://github.com/matagus/django-generic-links/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/matagus/django-generic-links/graph/badge.svg?token=a64SxEDQk0)](https://codecov.io/gh/matagus/django-generic-links) [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

Simple app to attach links to any Django model. Compatible with Django 4.x to 5.0 and Python 3.9 to 3.12.

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ dependencies = ["coverage[toml]", "django~={matrix:django}.0"]
[tool.hatch.envs.test.scripts]
test = "python -m django test --settings tests.settings"
test-cov = "coverage run -m django test --settings tests.settings"
cov-report = ["coverage combine", "coverage report"]
cov-report = ["coverage json", "coverage report"]
cov = ["test-cov", "cov-report"]
test-cov-report = ["test-cov", "cov-report"]

[tool.ruff]
line-length = 120
Expand Down

0 comments on commit d9c858a

Please sign in to comment.