forked from arbor-sim/arbor
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (215 loc) · 7.33 KB
/
test-everything.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: Test Everything
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
testallconfigs:
name: "Tests across OSes, versions, compilers, and build configs."
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: "Linux Min GCC",
os: "ubuntu-18.04",
cc: "gcc-8",
cxx: "g++-8",
py: "3.6",
cmake: "3.18.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux Min Clang",
os: "ubuntu-18.04",
cc: "clang-8",
cxx: "clang++-8",
py: "3.6",
cmake: "3.18.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "MacOS Min",
os: "macos-10.15",
cc: "clang",
cxx: "clang++",
py: "3.6",
cmake: "3.18.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux Max GCC",
os: "ubuntu-20.04",
cc: "gcc-10",
cxx: "g++-10",
py: "3.9",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux SIMD",
os: "ubuntu-20.04",
cc: "gcc-10",
cxx: "g++-10",
py: "3.9",
cmake: "3.22.x",
mpi: "OFF",
simd: "ON"
}
- {
name: "Linux Max Clang",
os: "ubuntu-20.04",
cc: "clang-10",
cxx: "clang++-10",
py: "3.9",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "MacOS Max",
os: "macos-11",
cc: "clang",
cxx: "clang++",
py: "3.9",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
variant: [static, shared]
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
# We set PYTHONPATH instead of installing arbor to avoid distribution/OS specific behaviour.
PYTHONPATH: ${{ github.workspace }}/build/python
# This is a workaround for the unfortunate interaction of MacOS and OpenMPI 4
# See https://github.com/open-mpi/ompi/issues/6518
OMPI_MCA_btl: "self,tcp"
steps:
- name: "Linux: get clang/gcc 8, libxml2"
if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install -y "clang-8" "lldb-8" "lld-8" "clang-format-8" g++-8 libxml2-dev
- name: "MacOS: get libxml2"
if: ${{ startsWith(matrix.config.os, 'macos') }}
run: |
brew install libxml2
- name: Set up cmake
uses: jwlawson/[email protected]
with:
cmake-version: ${{ matrix.config.cmake }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.config.py }}
- name: OpenMPI cache
uses: actions/cache@v2
id: cache-ompi
with:
path: ~/openmpi-4.0.2
key: ${{ matrix.config.os }}-openmpi-4.0.2-${{ matrix.config.cxx }}
- name: Build OpenMPI
if: ${{ steps.cache-ompi.outputs.cache-hit != 'true' }}
run: |
echo cache-hit='${{ steps.cache-ompi.outputs.cache-hit }}'
cd ~
wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.2.tar.gz
tar -xvf ./openmpi-4.0.2.tar.gz
cd openmpi-4.0.2
./configure --disable-mpi-fortran
make -j4
- name: Install OpenMPI
run: |
echo "Going to install ompi"
cd ~
cd openmpi-4.0.2
sudo make install
cd -
- name: Update shared library cache
if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
run: sudo ldconfig
- name: Install Python packages
run: pip install numpy sphinx svgwrite sphinx-rtd-theme mpi4py pandas seaborn
- name: Clone w/ submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Check config
run: |
$CC --version
$CXX --version
python --version
mpic++ --show
mpicc --show
echo $PYTHONPATH
- if: ${{ matrix.variant == 'static' }}
name: Build arbor
run: |
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC -DARB_WITH_PYTHON=ON -DARB_VECTORIZE=${{ matrix.config.simd }} -DPython3_EXECUTABLE=`which python` -DARB_WITH_MPI=${{ matrix.config.mpi }} -DARB_USE_BUNDLED_LIBS=ON -DARB_WITH_NEUROML=ON
make -j4 tests examples pyarb html
cd -
- if: ${{ matrix.variant == 'shared' }}
name: Build arbor
run: |
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC -DARB_WITH_PYTHON=ON -DARB_VECTORIZE=${{ matrix.config.simd }} -DPython3_EXECUTABLE=`which python` -DARB_WITH_MPI=${{ matrix.config.mpi }} -DARB_USE_BUNDLED_LIBS=ON -DARB_WITH_NEUROML=ON -DBUILD_SHARED_LIBS=ON
make -j4 tests examples pyarb html
cd -
- name: Install arbor
run: |
cd build
sudo make install
cd -
- name: Run unit tests
run: |
build/bin/unit
build/bin/unit-modcc
- if: ${{ matrix.config.mpi == 'ON' }}
name: Run MPI tests
run: mpirun -n 4 -oversubscribe build/bin/unit-mpi
- if: ${{ matrix.config.mpi == 'OFF' }}
name: Run examples
run: scripts/run_cpp_examples.sh
- if: ${{ matrix.config.mpi == 'ON' }}
name: Run examples with MPI
run: scripts/run_cpp_examples.sh "mpirun -n 4 -oversubscribe"
- name: Run python tests
run: |
python3 -m unittest discover -v -s python
- if: ${{ matrix.config.mpi == 'ON' }}
name: Run python+MPI tests
run: mpirun -n 4 -oversubscribe python3 -m unittest discover -v -s python
# - name: Run Python examples (plotting leads to time outs on macos, the step under testpip is enough)
# run: scripts/run_python_examples.sh
- name: Build and test a catalogue
run: |
arbor-build-catalogue -v default mechanisms/default
./scripts/test-catalogue.py ./default-catalogue.so
testpip:
name: "Pip build test + Python examples test"
runs-on: ubuntu-latest
steps:
- name: Install Python packages
run: pip install numpy setuptools scikit-build ninja cmake
- name: Clone w/ submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build and install Arbor using pip + build flags
run: python3 -m pip install --verbose --install-option="-DARB_VECTORIZE=ON" --install-option="-DARB_ARCH=native" .
- name: Check that build flags match
run: |
python3 -c "import arbor; print(arbor.config())" | grep -q "'arch': 'native'"
- name: Run Python tests
run: python3 -m unittest discover -v -s python
- name: Run Python examples
run: scripts/run_python_examples.sh