Merge pull request #93 from coganlab/plots-and-mats #144
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Tests' | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
pytest: | |
name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}' | |
timeout-minutes: 70 | |
continue-on-error: true | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
env: | |
PYTHON_VERSION: '${{ matrix.python }}' | |
MKL_NUM_THREADS: '1' | |
OPENBLAS_NUM_THREADS: '1' | |
PYTHONUNBUFFERED: '1' | |
MNE_CI_KIND: '${{ matrix.kind }}' | |
CI_OS_NAME: '${{ matrix.os }}' | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
python: '3.10' | |
kind: conda | |
- os: ubuntu-latest | |
python: '3.11' | |
kind: pip | |
- os: windows-latest | |
python: '3.11' | |
kind: mamba | |
steps: | |
- uses: actions/checkout@v4 | |
# Xvfb/OpenGL | |
- uses: pyvista/setup-headless-display-action@main | |
with: | |
qt: true | |
pyvista: false | |
# Python (if pip) | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: install pip requirements | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install flake8 pytest tqdm pyqt5-tools | |
if [ -f envs/requirements.txt ]; then pip install -r envs/requirements.txt; fi | |
if: startswith(matrix.kind, 'pip') | |
# Python (if conda) | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
activate-environment: test | |
environment-file: envs/environment.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
use-mamba: ${{ matrix.kind != 'conda' }} | |
if: ${{ !startswith(matrix.kind, 'pip') }} | |
# Check Qt on non-notebook | |
- run: ./.github/check_qt_import.sh $MNE_QT_BACKEND | |
if: ${{ env.MNE_QT_BACKEND != '' }} | |
- name: Test with pytest | |
run: | | |
pytest ieeg -v --cov=. --doctest-modules --pycodestyle --cov-report xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
if: matrix.kind == 'mamba' |