-
Notifications
You must be signed in to change notification settings - Fork 34
130 lines (128 loc) · 4.09 KB
/
unit_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
name: "unit_tests"
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }}
cancel-in-progress: true
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
jobs:
# Run installation tests
install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11"]
include:
# An old one
- os: ubuntu-latest
python-version: "3.9"
steps:
- uses: actions/checkout@v4
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager .[test]
- run: mne sys_info
- name: Build sdist
run: python setup.py sdist
- name: Install sdist
run: pip install ./dist/mne-connectivity-*
shell: bash -e {0}
- name: Clean up working directory
run: rm -rf ./*
shell: bash -e {0}
- name: Try importing mne_connectivity
run: python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
- name: Remove sdist install
run: pip uninstall -y mne-connectivity
# build with build wheet
- uses: actions/checkout@v4
- name: Build wheel
run: python setup.py bdist_wheel
- name: Install wheel
run: pip install ./dist/mne_connectivity-*.whl
shell: bash -e {0}
- name: Clean up working directory
run: rm -rf ./*
shell: bash -e {0}
- name: Try importing mne_connectivity
run: python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
- name: Remove wheel install
run: pip uninstall -y mne-connectivity
- uses: actions/checkout@v4
- name: Test extras install
run: |
pip install .[full]
python -c 'import mne_connectivity; print(mne_connectivity.__version__)'
# Run unit tests
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"
mne-version: mne-main
- os: ubuntu-latest
python-version: "3.11"
mne-version: mne-main
- os: macos-latest
python-version: "3.11"
mne-version: mne-main
- os: windows-latest
python-version: "3.11"
mne-version: mne-main
env:
TZ: Europe/Berlin
FORCE_COLOR: true
DISPLAY: ":99.0"
MNE_LOGGING_LEVEL: "info"
OPENBLAS_NUM_THREADS: "1"
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade --upgrade-strategy eager .[test]
- if: matrix.mne-version == 'mne-stable'
run: pip install --upgrade mne
- name: Install MNE (main)
if: matrix.mne-version == 'mne-main'
run: pip install git+https://github.com/mne-tools/mne-python@main
- run: python -c "import mne; print(mne.datasets.testing.data_path(verbose=True))"
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
- name: Display versions and environment information
run: |
echo $TZ
date
python --version
which python
- run: pip install -e .
- run: mne sys_info
- run: python -m pytest . --cov=mne_connectivity --cov-report=xml --cov-config=setup.cfg --verbose --ignore mne-python
- uses: codecov/codecov-action@v3