|
| 1 | +name: Install and Test with Pip |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: [ "main", "master" ] |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + python-version: ["3.9", "3.10", "3.11"] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + - name: Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v3 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python-version }} |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + # sudo apt install -y xvfb x11-utils libxkbcommon-x11-0 |
| 28 | + sudo apt-get -qq install libxcb-xinerama0 pyqt5-dev-tools |
| 29 | + python -m pip install --upgrade pip |
| 30 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 31 | + - name: Install test dependencies |
| 32 | + run: | |
| 33 | + pip install -r requirements-dev.txt |
| 34 | + pip install git+https://github.com/cortex-lab/phy.git |
| 35 | + - name: Test with pytest utils |
| 36 | + env: |
| 37 | + QT_DEBUG_PLUGINS: 1 |
| 38 | + run: | |
| 39 | + ulimit -c unlimited |
| 40 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/utils |
| 41 | +
|
| 42 | + - name: Test with pytest plot |
| 43 | + env: |
| 44 | + QT_DEBUG_PLUGINS: 1 |
| 45 | + run: | |
| 46 | + ulimit -c unlimited |
| 47 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/plot/tests |
| 48 | +
|
| 49 | + - name: Test with pytest gui |
| 50 | + env: |
| 51 | + QT_DEBUG_PLUGINS: 1 |
| 52 | + run: | |
| 53 | + ulimit -c unlimited |
| 54 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/gui/tests/test_actions.py |
| 55 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/gui/tests/test_gui.py |
| 56 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/gui/tests/test_state.py |
| 57 | +
|
| 58 | + - name: Test with pytest cluster |
| 59 | + env: |
| 60 | + QT_DEBUG_PLUGINS: 1 |
| 61 | + run: | |
| 62 | + ulimit -c unlimited |
| 63 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/cluster/tests/test_clustering.py |
| 64 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/cluster/tests/test_history.py |
| 65 | + sudo xvfb-run --auto-servernum `which coverage` run -m pytest phy/cluster/tests/test_utils.py |
| 66 | + |
0 commit comments