Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition to GitHub Actions for automated testing #287

Merged
merged 3 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: tests

on: [push, pull_request]

jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
env:
DISPLAY: ':99.0'

steps:
- name: Set up virtual framebuffer (xvfb) for Qt GUI testing
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions
run: |
sudo apt-get install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX

- name: Set up Python ${{ matrix.python-version }}
run: |
echo $CONDA/bin >> $GITHUB_PATH # prioritize conda over system python
conda config --add channels conda-forge
conda install -y -q python=${{ matrix.python-version }}
# conda create -y -q -n test-environment python=${{ matrix.python-version }}
# source activate test-environment

- name: Checkout repository
uses: actions/checkout@v2

- name: Install package from repository
run: |
pip install -e .

- name: Install extra depenencies
run: |
conda install -y -q av
pip install -r requirements-tests.txt

- name: Verify Python version
run: |
which python
python --version
python -c "import os, sys; assert sys.version_info[:2] == tuple(map(int, '${{ matrix.python-version }}'.split('.')))[:2]"

- name: List pip packages
run: |
pip -V
pip list

- name: List conda packages
run: |
conda env list
conda list

- name: Run tests
run: |
nosetests --with-coverage --cover-package=neurotic

- name: Report coverage to Coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-linux-${{ matrix.python-version }}
COVERALLS_PARALLEL: true

# - name: Report coverage to Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86 changes: 0 additions & 86 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

*Curate, visualize, annotate, and share your behavioral ephys data using Python*

|PyPI badge| |Anaconda badge| |GitHub badge| |Feedstock badge| |Constructor badge| |Docs badge| |Travis badge| |Azure badge| |Coverage badge| |Zenodo badge| |eNeuro badge|
|PyPI badge| |Anaconda badge| |GitHub badge| |Feedstock badge| |Constructor badge| |Docs badge| |GitHub Actions badge| |Azure badge| |Coverage badge| |Zenodo badge| |eNeuro badge|

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

Expand Down Expand Up @@ -349,9 +349,9 @@ reference guide, and release notes, see the Documentation_.
:target: ReadTheDocs_
:alt: Documentation status

.. |Travis badge| image:: https://img.shields.io/travis/com/jpgill86/neurotic/master.svg?logo=travis-ci&logoColor=white
:target: Travis_
:alt: Travis build status
.. |GitHub Actions badge| image:: https://github.com/jpgill86/neurotic/workflows/tests/badge.svg
:target: `GitHub Actions`_
:alt: Tests status

.. |Azure badge| image:: https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/neurotic-feedstock?branchName=master
:target: `conda-forge CI`_
Expand Down Expand Up @@ -386,6 +386,7 @@ reference guide, and release notes, see the Documentation_.
.. _ephyviewer: https://github.com/NeuralEnsemble/ephyviewer
.. _GIN: https://gin.g-node.org
.. _GitHub: https://github.com/jpgill86/neurotic
.. _GitHub Actions: https://github.com/jpgill86/neurotic/actions
.. _GitHub Releases: https://github.com/jpgill86/neurotic/releases
.. _Issue Tracker: https://github.com/jpgill86/neurotic/issues
.. _Neo: https://github.com/NeuralEnsemble/python-neo
Expand All @@ -394,6 +395,5 @@ reference guide, and release notes, see the Documentation_.
.. _PyPI: https://pypi.org/project/neurotic
.. _ReadTheDocs: https://readthedocs.org/projects/neurotic
.. _Release Notes: https://neurotic.readthedocs.io/en/latest/releasenotes.html
.. _Travis: https://travis-ci.com/jpgill86/neurotic
.. _User Interface: https://ephyviewer.readthedocs.io/en/latest/interface.html
.. _Zenodo: https://doi.org/10.5281/zenodo.3564990
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

*Curate, visualize, annotate, and share your behavioral ephys data using Python*

|PyPI badge| |Anaconda badge| |GitHub badge| |Feedstock badge| |Constructor badge| |Docs badge| |Travis badge| |Azure badge| |Coverage badge| |Zenodo badge| |eNeuro badge|
|PyPI badge| |Anaconda badge| |GitHub badge| |Feedstock badge| |Constructor badge| |Docs badge| |GitHub Actions badge| |Azure badge| |Coverage badge| |Zenodo badge| |eNeuro badge|

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

Expand Down Expand Up @@ -57,9 +57,9 @@ at the same datasets!
:target: ReadTheDocs_
:alt: Documentation status

.. |Travis badge| image:: https://img.shields.io/travis/com/jpgill86/neurotic/master.svg?logo=travis-ci&logoColor=white
:target: Travis_
:alt: Travis build status
.. |GitHub Actions badge| image:: https://github.com/jpgill86/neurotic/workflows/tests/badge.svg
:target: `GitHub Actions`_
:alt: Tests status

.. |Azure badge| image:: https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/neurotic-feedstock?branchName=master
:target: `conda-forge CI`_
Expand Down Expand Up @@ -89,9 +89,9 @@ at the same datasets!
.. _eNeuro: https://doi.org/10.1523/ENEURO.0085-20.2020
.. _ephyviewer: https://github.com/NeuralEnsemble/ephyviewer
.. _GitHub: https://github.com/jpgill86/neurotic
.. _GitHub Actions: https://github.com/jpgill86/neurotic/actions
.. _Neo: https://github.com/NeuralEnsemble/python-neo
.. _other versions: https://readthedocs.org/projects/neurotic/versions/
.. _PyPI: https://pypi.org/project/neurotic
.. _ReadTheDocs: https://readthedocs.org/projects/neurotic
.. _Travis: https://travis-ci.com/jpgill86/neurotic
.. _Zenodo: https://doi.org/10.5281/zenodo.3564990