Skip to content

Commit

Permalink
Add coveralls badge
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed May 17, 2023
1 parent d4bb0e5 commit 49c619d
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 5 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
on:
pull_request:
push:
branches: [ main, develop ]
branches: [ main ]

jobs:
test:
Expand Down Expand Up @@ -46,3 +46,32 @@ jobs:
inv ci.prepare
- name: Run checks ${{ matrix.python-version }}
run: inv git.run-hooks

coveralls:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
pip install --upgrade pip wheel setuptools
pip install --requirement requirements/local_build.txt
- name: Prepare env
run: |
inv ci.prepare
- name: Run tests
run: |
inv tests.run-ci
- name: Upload results to coveralls
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
History
=======

1.0.0 (2023-05-18)
------------------
* First major release

0.1.3 (2023-05-15)
------------------
Migrate from ``setup.py`` and ``setup.cfg`` to ``pyproject.toml``
* Migrate from ``setup.py`` and ``setup.cfg`` to ``pyproject.toml``

0.1.2 (2023-05-12)
------------------
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ django-import-export-extensions
:target: https://github.com/saritasa-nest/django-import-export-extensions/actions/workflows/checks.yml
:alt: Build status on Github

.. image:: https://coveralls.io/repos/github/saritasa-nest/django-import-export-extensions/badge.svg?branch=main
:target: https://coveralls.io/github/saritasa-nest/django-import-export-extensions?branch=main
:alt: Test coverage

.. image:: https://img.shields.io/badge/python%20versions-3.9%20%7C%203.10%20%7C%203.11-blue
:target: https://pypi.org/project/django-import-export-extensions/
:alt: Supported python versions
Expand Down
2 changes: 1 addition & 1 deletion import_export_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Saritasa"""
__email__ = "pypi@saritasa.com"
__version__ = "0.1.3"
__version__ = "1.0.0"
7 changes: 7 additions & 0 deletions provision/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ def run_python(context, command: str, watchers=()):
" ".join(["python3", command]),
watchers=watchers,
)

def run_coverage(context, command: str, watchers=()):
"""Run command using coverage."""
return context.run(
" ".join(["coverage run", command]),
watchers=watchers,
)
7 changes: 6 additions & 1 deletion provision/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ def run(context, params=""):
@task
def run_ci(context):
"""Run tests in github actions."""
run(context, params="-v")
start.run_coverage(
context,
"--source import_export_extensions "
"--omit import_export_extensions/migrations "
"-m pytest -v",
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
Expand Down
3 changes: 3 additions & 0 deletions requirements/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ Werkzeug

# Needed for documentation generation
watchdog

# Code coverage testing for Python.
coverage

0 comments on commit 49c619d

Please sign in to comment.