forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (128 loc) · 3.94 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: 'Tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches:
- '*'
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
style:
name: Style
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: psf/black@stable
- uses: pre-commit/[email protected]
bandit:
name: Bandit
needs: style
runs-on: ubuntu-latest
steps:
- uses: davidslusser/[email protected]
with:
src: "mne"
options: "-c pyproject.toml -ll -r"
pip_install_command: "pip install bandit[toml]"
pytest:
name: '${{ matrix.os }} / ${{ matrix.kind }} / ${{ matrix.python }}'
needs: style
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: ubuntu-latest
python: '3.10'
kind: conda
- os: ubuntu-latest
python: '3.10'
kind: notebook
- os: ubuntu-latest
python: '3.11'
kind: pip-pre
- os: macos-latest
python: '3.8'
kind: mamba
- os: windows-latest
python: '3.10'
kind: mamba
- os: ubuntu-latest
python: '3.8'
kind: minimal
- os: ubuntu-20.04
python: '3.8'
kind: old
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ./tools/github_actions_env_vars.sh
# Xvfb/OpenGL
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
if: matrix.kind != 'notebook'
# Python (if pip)
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
if: startswith(matrix.kind, 'pip')
# Python (if conda)
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
environment-file: ${{ env.CONDA_ENV }}
activate-environment: mne
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: ${{ matrix.kind != 'conda' }}
if: ${{ !startswith(matrix.kind, 'pip') }}
- name: 'Install OSMesa VTK variant'
run: |
# TODO: As of 2023/02/28, notebook tests need a pinned mesalib
mamba install -c conda-forge "vtk>=9.2=*osmesa*" "vtk-base>=9.2=*osmesa*" "mesalib=23.1.4"
mamba list
if: matrix.kind == 'notebook'
- run: ./tools/github_actions_dependencies.sh
# Minimal commands on Linux (macOS stalls)
- run: ./tools/get_minimal_commands.sh
if: ${{ startswith(matrix.os, 'ubuntu') }}
- run: ./tools/github_actions_install.sh
- run: ./tools/github_actions_infos.sh
# Check Qt on non-notebook
- run: ./tools/check_qt_import.sh $MNE_QT_BACKEND
if: ${{ env.MNE_QT_BACKEND != '' }}
- name: Run tests with no testing data
run: MNE_SKIP_TESTING_DATASET_TESTS=true pytest -m "not (ultraslowtest or pgtest)" --tb=short --cov=mne --cov-report xml -vv -rfE mne/
if: matrix.kind == 'minimal'
- run: ./tools/get_testing_version.sh
- uses: actions/cache@v3
with:
key: ${{ env.TESTING_VERSION }}
path: ~/mne_data
- run: ./tools/github_actions_download.sh
- run: ./tools/github_actions_test.sh
- uses: codecov/codecov-action@v3
if: success()