Skip to content

Commit

Permalink
Merge pull request #144 from jpgill86/coverage
Browse files Browse the repository at this point in the history
Add Coveralls test coverage reporting to GitHub Actions workflow
  • Loading branch information
jpgill86 committed Jan 24, 2021
2 parents cd1a6b0 + c983a33 commit 4a5efba
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 27 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# configuration of coverage.py
# https://coverage.readthedocs.io

[report]
omit =
ephyviewer/icons/icons_py2_Qt4.py
ephyviewer/icons/make_resources.py
ephyviewer/tests/*
24 changes: 23 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,26 @@ jobs:
- name: Run tests
run: |
nosetests
nosetests --with-coverage --cover-package=ephyviewer
- name: Report coverage to Coveralls
run: coveralls
env:
COVERALLS_SERVICE_NAME: github
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-linux-${{ matrix.python-version }}
COVERALLS_PARALLEL: true

coveralls:
name: Finish Coveralls
needs: test-linux
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finish Coveralls
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
COVERALLS_SERVICE_NAME: github
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ephyviewer.egg-info/*
*.csv
/.idea
/venv
.coverage
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ephyviewer

:Distributions: |pypi-badge| |anaconda-cloud-badge|
:Source Code: |github-badge| |conda-forge-feedstock-badge|
:Tests Status: |github-actions-badge| |conda-forge-azure-badge| |rtd-status-badge|
:Tests Status: |github-actions-badge| |conda-forge-azure-badge| |rtd-status-badge| |coveralls-badge|

Documentation_ | `Release Notes`_ | `Issue Tracker`_

Expand Down Expand Up @@ -97,13 +97,18 @@ Check the docs for more examples_.
:target: rtd-status_
:alt: Documentation Status

.. |coveralls-badge| image:: https://coveralls.io/repos/github/NeuralEnsemble/ephyviewer/badge.svg?branch=master
:target: coveralls_
:alt: Coverage status

.. |screenshot| image:: https://raw.githubusercontent.com/NeuralEnsemble/ephyviewer/master/doc/img/mixed_viewer_example.png
:target: https://raw.githubusercontent.com/NeuralEnsemble/ephyviewer/master/doc/img/mixed_viewer_example.png
:alt: Screenshot

.. _anaconda-cloud: https://anaconda.org/conda-forge/ephyviewer
.. _conda-forge-azure: https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=8410&branchName=master
.. _conda-forge-feedstock: https://github.com/conda-forge/ephyviewer-feedstock
.. _coveralls: https://coveralls.io/github/NeuralEnsemble/ephyviewer?branch=master
.. _Documentation: https://ephyviewer.readthedocs.io/en/latest
.. _examples: https://ephyviewer.readthedocs.io/en/latest/examples.html
.. _github: https://github.com/NeuralEnsemble/ephyviewer
Expand Down
7 changes: 6 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

:Distributions: |pypi-badge| |anaconda-cloud-badge|
:Source Code: |github-badge| |conda-forge-feedstock-badge|
:Tests Status: |github-actions-badge| |conda-forge-azure-badge| |rtd-status-badge|
:Tests Status: |github-actions-badge| |conda-forge-azure-badge| |rtd-status-badge| |coveralls-badge|

**Version:** |version| (`other versions`_)

Expand Down Expand Up @@ -71,12 +71,17 @@ Table of Contents
:target: rtd-status_
:alt: Documentation Status

.. |coveralls-badge| image:: https://coveralls.io/repos/github/NeuralEnsemble/ephyviewer/badge.svg?branch=master
:target: coveralls_
:alt: Coverage status

.. |screenshot| image:: img/mixed_viewer_example.png
:alt: Screenshot

.. _anaconda-cloud: https://anaconda.org/conda-forge/ephyviewer
.. _conda-forge-azure: https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=8410&branchName=master
.. _conda-forge-feedstock: https://github.com/conda-forge/ephyviewer-feedstock
.. _coveralls: https://coveralls.io/github/NeuralEnsemble/ephyviewer?branch=master
.. _github: https://github.com/NeuralEnsemble/ephyviewer
.. _github-actions: https://github.com/NeuralEnsemble/ephyviewer/actions?query=workflow%3Atests
.. _other versions: https://readthedocs.org/projects/ephyviewer/versions/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
print('QT_MODE', QT_MODE)


def make_ressoureces_icons():
def make_resources_icons():
with open('icons.qrc','w') as f:
f.write("""<!DOCTYPE RCC><RCC version="1.0">
<qresource>
Expand All @@ -14,25 +14,24 @@ def make_ressoureces_icons():
for filename in files:
if filename.endswith('.png') or filename.endswith('.jpg') or filename.endswith('.svg'):
f.write(' <file alias="%s">%s/%s</file>\r\n' % (filename, p[2:],filename) )

f.write(""" </qresource>
</RCC>
""")

if QT_MODE=='PyQt4':
if sys.version_info > (3,):
os.popen('pyrcc4 -py3 icons.qrc -o icons_py3_Qt4.py')
else:
os.popen('pyrcc4 icons.qrc -o icons_py2_Qt4.py')

elif QT_MODE=='PyQt5':
if sys.version_info > (3,):
os.popen('pyrcc5 icons.qrc -o icons_py3.py')
else:
raise(NotImplementedError)


#------------------------------------------------------------------------------
if __name__ == '__main__' :
make_ressoureces_icons()

make_resources_icons()
17 changes: 0 additions & 17 deletions ephyviewer/icons/test_ressources.py

This file was deleted.

15 changes: 15 additions & 0 deletions ephyviewer/tests/test_resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ephyviewer import QT, mkQApp


def test_icons(interactive=False):
app = mkQApp()
w = QT.QWidget()
w.setWindowIcon(QT.QIcon(':/media-playback-start.svg'))

if interactive:
w.show()
app.exec_()


if __name__ == '__main__' :
test_icons(interactive=True)
1 change: 1 addition & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
av
coveralls
neo
nose
pandas
Expand Down

0 comments on commit 4a5efba

Please sign in to comment.