Final testing #14
This file contains hidden or 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: Test NEURON Environments (macOS + Windows) | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| # Use a login bash shell everywhere so that `setup-miniconda` activation works. | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| # ======================== | |
| # macOS: test mac env + NEURON | |
| # ======================== | |
| test-macos-env: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Miniconda and create macOS environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| # MUST match the name inside environment_mac.yml | |
| activate-environment: neuron_env | |
| environment-file: environment_mac.yml | |
| auto-activate-base: false | |
| python-version: "3.10" | |
| channels: conda-forge, defaults | |
| use-mamba: true | |
| - name: Show Python and system info (macOS) | |
| run: | | |
| which python | |
| python -V | |
| python -c "import platform; print('Platform:', platform.platform())" | |
| python -c "import sys; print('Python executable:', sys.executable)" | |
| - name: Test core scientific stack (macOS) | |
| run: | | |
| python -c "import numpy, scipy, matplotlib, pandas; \ | |
| print('NumPy:', numpy.__version__); \ | |
| print('SciPy:', scipy.__version__); \ | |
| print('Matplotlib:', matplotlib.__version__); \ | |
| print('Pandas:', pandas.__version__)" | |
| - name: Test NEURON import (macOS) | |
| run: | | |
| python -c "import neuron; print('NEURON (macOS) imported successfully, version:', neuron.__version__)" | |
| - name: Compile MOD files (macOS) | |
| run: | | |
| set -e # fail on first error | |
| echo "Repo root:" | |
| pwd | |
| ls | |
| # List of MOD folders relative to the repo root | |
| MOD_DIRS=( | |
| "optimization/mod" | |
| "optimization/3D_and_bar_graphs/mod" | |
| ) | |
| for MODPATH in "${MOD_DIRS[@]}"; do | |
| echo "-----------------------------------------" | |
| echo "Compiling MODs in: $MODPATH" | |
| echo "-----------------------------------------" | |
| cd "$GITHUB_WORKSPACE/$MODPATH" | |
| echo "Current dir: $(pwd)" | |
| ls | |
| # Compile all .mod files in this directory | |
| nrnivmodl | |
| echo "After nrnivmodl, contents of $(pwd):" | |
| ls | |
| done | |
| - name: Run MOD smoke tests (macOS) | |
| run: | | |
| python -m pip install pytest | |
| pytest -q tests/test_mods_smoke.py | |
| # ======================== | |
| # Windows: test windows env (NO NEURON) | |
| # ======================== | |
| test-windows-env: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Miniconda and create Windows environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| # MUST match the name inside environment_windows.yml | |
| activate-environment: neuron_env | |
| environment-file: environment_windows.yml | |
| auto-activate-base: false | |
| python-version: "3.10" | |
| channels: conda-forge, defaults | |
| use-mamba: true | |
| - name: Show Python and system info (Windows) | |
| run: | | |
| which python | |
| python -V | |
| python -c "import platform; print('Platform:', platform.platform())" | |
| python -c "import sys; print('Python executable:', sys.executable)" | |
| - name: Test core scientific stack (Windows) | |
| run: | | |
| python -c "import numpy, scipy, matplotlib, pandas; \ | |
| print('NumPy:', numpy.__version__); \ | |
| print('SciPy:', scipy.__version__); \ | |
| print('Matplotlib:', matplotlib.__version__); \ | |
| print('Pandas:', pandas.__version__)" |