Skip to content

Merge pull request #181 from samuelgarcia/prepare_release #155

Merge pull request #181 from samuelgarcia/prepare_release

Merge pull request #181 from samuelgarcia/prepare_release #155

Workflow file for this run

name: tests
on: [push, pull_request]
jobs:
test-docs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout repository
uses: actions/checkout@v2
- name: Install package from repository with docs dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
- name: List pip packages
run: |
pip -V
pip list
- name: Build docs
run: |
cd doc
make html
test-linux:
runs-on: ubuntu-20.04 # because Qt 6 requires glibc >= 2.28, which ubuntu-latest does not have
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
qt-version: [PyQt5, PySide2, PySide6]
# exclude:
# - qt-version: PySide2
# python-version: '3.9'
env:
DISPLAY: ':99.0'
XDG_RUNTIME_DIR: /tmp/runtime-runner
NEO_TEST_FILES: ~/ephy_testing_data_http
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: Install OpenGL and EGL
# https://github.com/pyqtgraph/pyqtgraph/pull/1495#issuecomment-761397669
if: ${{ matrix.qt-version == 'PySide6' }}
run: |
sudo apt-get install -y libopengl0 libegl1-mesa
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Install package from repository with test dependencies
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.qt-version }}
pip install -e .[tests]
- name: Upgrade to latest pyqtgraph
if: ${{ matrix.pyqtgraph-dev }}
run: |
pip install -U git+https://github.com/pyqtgraph/pyqtgraph.git@master
- name: List pip packages
run: |
pip -V
pip list
- name: Check Qt bindings library
run: |
python -c "from ephyviewer import QT_MODE; assert QT_MODE == '${{ matrix.qt-version }}', 'Wrong Qt bindings: ' + QT_MODE"
- name: Restore cached Neo data files (if available)
# if the data files were recently downloaded during another job, they
# will be available in a cache. otherwise, this step prepares a cache
# to be created after the job completes.
uses: actions/cache@v2
with:
path: ${{ env.NEO_TEST_FILES }}
key: ${{ runner.os }}-${{ hashFiles('**/testing_tools.py') }}
- name: Download Neo data files (if cache could not be restored)
# these data files would be downloaded automatically when tests are
# run, but by downloading them ahead of time in a separate step we
# can monitor the progress in GitHub Actions. if the files already
# exist (because they were restored from the cache), no work is done.
# python -c "from ephyviewer.tests.testing_tools import get_tdt_test_files; get_tdt_test_files();"
run: |
python -c "from ephyviewer.tests.testing_tools import get_blackrock_files; get_blackrock_files();"
ls -lR ${{ env.NEO_TEST_FILES }}
- name: Run tests
run: |
pytest -v --cov
- 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 }}-${{ matrix.qt-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 }}