Skip to content

Commit

Permalink
Add coverage measurement/reporting and GitHub Actions workflow; updat…
Browse files Browse the repository at this point in the history
…e README.
  • Loading branch information
lapets committed Aug 29, 2023
1 parent 8093dbe commit a32f6a4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/lint-test-cover-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: lint-test-cover-docs
on:
push
jobs:
lint_test_cover_docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
name: "Python ${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v3
- name: Install Python.
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Lint and test module.
run: |
pip install -U .[lint,test]
python -m pylint permutations # Check against linting rules.
python -m pytest # Run tests.
python src/permutations/permutations.py -v # Run tests via execution.
- name: Publish coverage results.
run: |
pip install -U .[coveralls]
python -m coveralls --service=github # Submit to coveralls.
if: matrix.python-version == '3.11'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Test auto-generation of documentation.
run: |
pip install -U .[docs]
cd docs && sphinx-apidoc -f -E --templatedir=_templates -o _source .. && make html && cd ..
10 changes: 9 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ permutations

Python library for instantiating and working with permutation collections that provide efficient implementations of all sequence methods (including random-access retrieval by index).

|pypi|
|pypi| |actions| |coveralls|

.. |pypi| image:: https://badge.fury.io/py/permutations.svg
:target: https://badge.fury.io/py/permutations
:alt: PyPI version and link.

.. |actions| image:: https://github.com/lapets/permutations/workflows/lint-test-cover-docs/badge.svg
:target: https://github.com/lapets/permutations/actions/workflows/lint-test-cover-docs.yml
:alt: GitHub Actions status.

.. |coveralls| image:: https://coveralls.io/repos/github/lapets/permutations/badge.svg?branch=main
:target: https://coveralls.io/github/lapets/permutations?branch=main
:alt: Coveralls test coverage summary.

Purpose
-------

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ test = [
lint = [
"pylint~=2.17.0"
]
coveralls = [
"coveralls~=3.3.1"
]
publish = [
"build~=0.10",
"twine~=4.0"
Expand Down

0 comments on commit a32f6a4

Please sign in to comment.