From baa852262d856eae360cc05ac6bad8ef11d6ff6e Mon Sep 17 00:00:00 2001 From: Jeffrey Gill Date: Sun, 27 Dec 2020 19:26:17 -0500 Subject: [PATCH 1/3] Add GitHub Actions workflow for running tests --- .github/workflows/tests.yml | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..adae7d9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 }} From 448a51fb2180ac5e01f51445371191afac26fd2e Mon Sep 17 00:00:00 2001 From: Jeffrey Gill Date: Sun, 27 Dec 2020 19:42:54 -0500 Subject: [PATCH 2/3] Update README and docs with GitHub Actions badge --- README.rst | 10 +++++----- docs/index.rst | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 3ae762d..f453a44 100644 --- a/README.rst +++ b/README.rst @@ -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`_ @@ -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`_ @@ -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 @@ -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 diff --git a/docs/index.rst b/docs/index.rst index 690683c..db0ecde 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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`_) @@ -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`_ @@ -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 From f0c8364b05a8d7933441ed713fd1f1652b82667e Mon Sep 17 00:00:00 2001 From: Jeffrey Gill Date: Sun, 27 Dec 2020 19:45:27 -0500 Subject: [PATCH 3/3] Remove Travis CI config file --- .travis.yml | 86 ----------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab45fa0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,86 +0,0 @@ -dist: xenial # required for Python >= 3.7 - -language: python -python: - # We don't actually use the Travis Python, but this keeps it organized. - - "3.6" - - "3.7" - - "3.8" - - "3.9" - -matrix: - include: - - name: Sphinx docs - python: "3.7" - env: JOB_REQS="requirements-docs.txt" - script: - - cd docs - - make html - after_success: skip - - - name: Future - python: "3.9" - before_script: - # install dev versions of important packages - - pip install -U \ - git+https://github.com/NeuralEnsemble/python-neo.git \ - git+https://github.com/NeuralEnsemble/ephyviewer.git - - # list versions - - python --version - - python -c "import os, sys; assert sys.version_info[:2] == tuple(map(int, os.environ['TRAVIS_PYTHON_VERSION'].split('.')))[:2]" - - pip -V - - pip list - - conda list - - allow_failures: - - name: Future - - fast_finish: true - -env: JOB_REQS="requirements-tests.txt" - -services: - - xvfb # create a virtual display on the headless server for gui tests - -install: - - sudo apt-get update - - apt list --installed - - # install conda - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - - conda info -a - - # create python environment - - conda config --add channels conda-forge - - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION - - source activate test-environment - - echo "INSTALLING REQS FOR NEUROTIC" - - conda install -c conda-forge av pyqt # conda-forge's pyqt works better on Travis than pip's PyQt5 - - echo "INSTALLING REQS FOR THIS JOB" - - pip install -r ${JOB_REQS}; - - # install package - - echo "INSTALLING NEUROTIC" - - pip install -e . - -before_script: - # list versions - - python --version - - python -c "import os, sys; assert sys.version_info[:2] == tuple(map(int, os.environ['TRAVIS_PYTHON_VERSION'].split('.')))[:2]" - - pip -V - - pip list - - conda list - -script: - # run tests - nosetests --with-coverage --cover-package=neurotic - -after_success: - # report test coverage to Coveralls - coveralls || echo "coveralls failed"