-
Notifications
You must be signed in to change notification settings - Fork 56
85 lines (82 loc) · 2.77 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
name: neuromaps-tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
check_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
- name: Run style checks
run: ruff check .
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run codespell
uses: codespell-project/actions-codespell@v2
run_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pytest pytest-cov codecov
python -m pip install git+https://github.com/netneurolab/netneurotools
- name: Install connectome workbench
run: |
while true; do
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --no-dns-cache -c \
https://www.humanconnectome.org/storage/app/media/workbench/workbench-linux64-v1.5.0.zip && break
done
unzip workbench-linux64-v1.5.0.zip -d ${HOME}
echo "$HOME/workbench/bin_linux64" >> $GITHUB_PATH
- name: Install neuromaps
run: python -m pip install .
- name: Print neuromaps version
run: python -c "import neuromaps; print(neuromaps.__version__)"
- name: Test submodule import
run: |
cd ..
python -c "from neuromaps import parcellate; from neuromaps.datasets import available_annotations"
- name: Run tests
run: pytest --doctest-modules --cov=neuromaps --cov-report=xml --junitxml=junit/test-results.xml --verbose --pyargs neuromaps
- uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
verbose: true
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/test-results.xml