Skip to content

adding echos to env variables #153

adding echos to env variables

adding echos to env variables #153

Workflow file for this run

name: Unit tests
on:
push:
branches: ['**']
pull_request:
branches: ['**']
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Install ubuntu dependencies
shell: bash -el {0}
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install build-essential wget
sudo apt-get install libopenmpi-dev openmpi-bin
fi;
- name: Install macos dependencies
shell: bash -el {0}
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
brew install open-mpi
echo "export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
echo "export MPI_LIB_NRN_PATH=/usr/local/lib" >> $GITHUB_ENV
echo "List /opt/homebrew/lib"
ls /opt/homebrew/lib
echo "List /opt/homebrew/Cellar/open-mpi/5.0.3_1/lib"
ls /opt/homebrew/Cellar/open-mpi/5.0.3_1/lib
export MPI_LIB_NRN_PATH=/opt/homebrew/Cellar/open-mpi/5.0.3_1/lib
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/open-mpi/5.0.3_1/lib:$DYLD_LIBRARY_PATH
echo "DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH"
fi;
- name: Print which mpirun mpiexec
shell: bash -el {0}
run: |
mpiexec --version
which mpirun mpiexec
if [ "${{ matrix.os }}" == "macos-latest" ]; then
echo $DYLD_LIBRARY_PATH
echo $MPI_LIB_NRN_PATH
fi;
# - name: Install dependencies
# shell: bash -el {0}
# run: |
# python -m pip install --upgrade pip
# pip install --yes -c conda-forge mpi4py openmpi
# - uses: conda-incubator/setup-miniconda@v2
# with:
# activate-environment: test
# python-version: ${{ matrix.python-version }}
# fetch-depth: 2
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }} # install the python version needed
cache: "pip"
- name: Install dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install openmpi mpi4py neuron
# - name: Set environment variables
# run: |
# echo "export MPI_HOME=$CONDA_PREFIX" >> $GITHUB_ENV
# echo "export PATH=$MPI_HOME/bin:$PATH" >> $GITHUB_ENV
# echo "export LD_LIBRARY_PATH=$MPI_HOME/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Check MPI version
shell: bash -el {0}
run: |
mpiexec --version
- name: Print mpi4py config
shell: bash -el {0}
run: |
python ./hnn_core/mpi4py_test.py
- 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: |
mpiexec -np 2 python ./hnn_core/mpi_test.py
- name: Verify NEURON installation
shell: bash -el {0}
run: |
echo $MPI_LIB_NRN_PATH
echo $DYLD_LIBRARY_PATH
nrniv -python -nobanner -mpi -c "from neuron import h; print(h)"
- name: Run MPI application with NEURON
shell: bash -el {0}
run: |
mpiexec -np 2 -verbose nrniv -python -mpi -nobanner 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: |
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