-
Notifications
You must be signed in to change notification settings - Fork 139
138 lines (135 loc) · 5.03 KB
/
Copy pathfull-test.yml
File metadata and controls
138 lines (135 loc) · 5.03 KB
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
133
134
135
136
137
138
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run all tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.12", "3.14"]
os: ["ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v6
- uses: mpi4py/setup-mpi@v1
if: startsWith(matrix.os, 'ubuntu')
with:
mpi: openmpi
- uses: mpi4py/setup-mpi@v1
if: startsWith(matrix.os, 'windows')
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Linux system dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install libltdl-dev libgsl0-dev python3-all-dev openmpi-bin libopenmpi-dev libboost-dev
- name: Install basic Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov coveralls flake8
- name: Install Brian 2
run: |
python -m pip install brian2
- name: Install NEURON
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install "neuron>=9.0.0" morphio
python -m pip install "nrnutils>0.2.0"
- name: Install NEST
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install "cython<3.1.0"
wget https://github.com/nest/nest-simulator/archive/refs/tags/v3.10.tar.gz -O nest-simulator-3.10.tar.gz
tar xzf nest-simulator-3.10.tar.gz
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local -Dwith-mpi=ON ./nest-simulator-3.10
make
make install
- name: Install Arbor
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install arbor==0.10.0 libNeuroML morphio
- name: Install NESTML
if: startsWith(matrix.os, 'ubuntu')
run: |
python -m pip install https://github.com/nest/nestml/archive/refs/tags/v8.3.0.tar.gz
- name: Install PyNN itself
run: |
python -m pip install -e ".[test,nestml]"
- name: Test installation has worked (Ubuntu)
# this is needed because the PyNN tests are just skipped if the simulator
# fails to install, so we need to catch import failures separately
if: startsWith(matrix.os, 'ubuntu')
run: |
python -c "import pyNN.nest"
python -c "import pyNN.neuron"
python -c "import pyNN.brian2"
python -c "import pyNN.arbor"
- name: Test installation has worked (Windows)
if: startsWith(matrix.os, 'windows')
run: |
python -c "import pyNN.brian2"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 pyNN --count --select=E9,F63,F7,F82 --ignore=F821,F824 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 pyNN --count --exit-zero --max-complexity=20 --max-line-length=127 --statistics
- name: Run unit and system tests
run: |
pytest -v -n auto --cov=pyNN --cov-report=term test
- name: Upload coverage data
run: |
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true
arbor-versions:
# Check that the Arbor backend works across the supported version range
name: Arbor ${{ matrix.arbor-version }} (Ubuntu, Python 3.12)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arbor-version: ["0.10.0", "0.12.2"]
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Arbor ${{ matrix.arbor-version }} and dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest scipy
python -m pip install "arbor==${{ matrix.arbor-version }}" libNeuroML morphio
- name: Install PyNN itself
run: |
python -m pip install -e ".[test]"
- name: Test that the Arbor backend imports (builds the catalogue)
run: |
python -c "import arbor; print('arbor', arbor.__version__)"
python -c "import pyNN.arbor"
- name: Run Arbor unit and scenario tests
run: |
pytest -v test/unittests/test_arbor.py test/system/scenarios -k arbor
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}