adding hnn installation command #126
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
push: | |
branches: ['**'] | |
pull_request: | |
branches: ['**'] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ubuntu dependencies | |
shell: bash -el {0} | |
run: | | |
sudo DEBIAN_FRONTEND=noninteractive apt-get update | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential wget | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install libopenmpi-dev openmpi-bin | |
- name: Check MPI version | |
shell: bash -el {0} | |
run: | | |
mpiexec --version | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: test | |
python-version: ${{ matrix.python-version }} | |
fetch-depth: 2 | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: | | |
python -m pip install --upgrade pip | |
conda install --yes -c conda-forge openmpi mpi4py neuron | |
- name: Print mpi4py config | |
shell: bash -el {0} | |
run: | | |
python ./hnn_core/mpi4py_test.py | |
- name: Print which mpirun mpiexec | |
shell: bash -el {0} | |
run: | | |
conda activate test | |
mpiexec --version | |
which mpirun mpiexec | |
- name: Install HNN-core | |
shell: bash -el {0} | |
run: | | |
pip install --verbose '.[opt, parallel, test, gui]' | |
- name: Run MPI application | |
shell: bash -el {0} | |
run: | | |
conda activate test | |
mpiexec -np 2 /usr/share/miniconda/envs/test/bin/python ./hnn_core/mpi_test.py | |
- name: Verify NEURON installation | |
shell: bash -el {0} | |
run: | | |
conda activate test | |
nrniv -python -nobanner -mpi -c "from neuron import h; print(h)" | |
- name: Run MPI application with NEURON | |
shell: bash -el {0} | |
run: | | |
conda activate test | |
mpiexec -np 2 -verbose nrniv -python -mpi -nobanner /usr/share/miniconda/envs/test/bin/python ./hnn_core/mpi_test.py | |
#- name: Lint with flake8 | |
# shell: bash -el {0} | |
# run: | | |
# flake8 --count hnn_core | |
- name: Test with pytest | |
shell: bash -el {0} | |
run: | | |
conda activate test | |
python -m pytest ./hnn_core/tests/test_dipole.py --cov=hnn_core --cov-report=xml -s | |
# # - name: Upload coverage to Codecov | |
# shell: bash -el {0} | |
# run: | | |
# bash <(curl -s https://codecov.io/bash) -f ./coverage.xml |