Add STDP code generation for SpiNNaker target #3064
Workflow file for this run
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: NESTML build | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| link_checker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Link Checker | |
| uses: lycheeverse/[email protected] | |
| with: | |
| args: --verbose --no-progress **/*.md **/*.html **/*.rst | |
| fail: true | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| static_checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pycodestyle | |
| - name: Static code style analysis | |
| run: | | |
| python3 extras/codeanalysis/check_copyright_headers.py && python3 -m pycodestyle $GITHUB_WORKSPACE -v --ignore=E241,E501,E714,E713,E714,E252,W503 --exclude=$GITHUB_WORKSPACE/doc,$GITHUB_WORKSPACE/.git,$GITHUB_WORKSPACE/NESTML.egg-info,$GITHUB_WORKSPACE/pynestml/generated,$GITHUB_WORKSPACE/extras,$GITHUB_WORKSPACE/build,$GITHUB_WORKSPACE/.github | |
| grammar_check: | |
| # check consistency of the grammar and lexer/parser: verify that when generated by Antlr, the lexer/parser are identical to the ones in the repository | |
| needs: [static_checks] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Install Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '11.0.x' | |
| java-package: jre | |
| - name: Install Antlr4 | |
| run: | | |
| wget http://www.antlr.org/download/antlr-4.13.2-complete.jar | |
| echo \#\!/bin/bash > antlr4 | |
| echo java -cp \"`pwd`/antlr-4.13.2-complete.jar:$CLASSPATH\" org.antlr.v4.Tool \"\$@\" >> antlr4 | |
| echo >> antlr4 | |
| chmod +x antlr4 | |
| echo PATH=$PATH:`pwd` >> $GITHUB_ENV | |
| - name: Generate lexer and parser using Antlr4 | |
| run: | | |
| mv -v pynestml/generated/PyNestMLLexer.py pynestml/generated/PyNestMLLexer.p_ | |
| mv -v pynestml/generated/PyNestMLParser.py pynestml/generated/PyNestMLParser.p_ | |
| cd pynestml/grammars | |
| ./generate_lexer_parser | |
| - name: Check that generated lexer and parser code is identical | |
| run: | | |
| cmp -s pynestml/generated/PyNestMLLexer.py pynestml/generated/PyNestMLLexer.p_ | |
| cmp -s pynestml/generated/PyNestMLParser.py pynestml/generated/PyNestMLParser.p_ | |
| unit_tests: | |
| needs: [grammar_check] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libncurses5-dev pkg-config | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy | |
| python -m pip install -r requirements.txt | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| #echo PYTHONPATH=`pwd` >> $GITHUB_ENV | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| - name: Run unit tests | |
| run: | | |
| pytest -s -o norecursedirs='*' -o log_cli=true -o log_cli_level="DEBUG" tests | |
| build_and_test_py_standalone: | |
| needs: [unit_tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libgsl0-dev libncurses5-dev pkg-config | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy | |
| python -m pip install -r requirements.txt | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| #echo PYTHONPATH=`pwd` >> $GITHUB_ENV | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| - name: Run integration tests | |
| run: | | |
| rc=0 | |
| for fn in $GITHUB_WORKSPACE/tests/python_standalone_tests/*.py; do | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1 | |
| done; | |
| exit $rc | |
| build_and_test_nest_desktop: | |
| needs: [unit_tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libgsl0-dev libncurses5-dev pkg-config libltdl-dev | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy | |
| python -m pip install -r requirements.txt | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| #echo PYTHONPATH=`pwd` >> $GITHUB_ENV | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| - name: Run integration tests | |
| run: | | |
| rc=0 | |
| for fn in $GITHUB_WORKSPACE/tests/nest_desktop_tests/*.py; do | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1 | |
| done; | |
| exit $rc | |
| build_and_test_nest: | |
| needs: [unit_tests] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| nest_branch: ["v2.20.2", "v3.0", "v3.9", "master"] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libltdl-dev libgsl0-dev libncurses5-dev libreadline6-dev pkg-config | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy pandas | |
| python -m pip install -r requirements.txt | |
| - name: Install NEST simulator | |
| run: | | |
| python -m pip install "cython<=3.0.10" | |
| echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" | |
| NEST_SIMULATOR=$(pwd)/nest-simulator | |
| NEST_INSTALL=$(pwd)/nest_install | |
| echo "NEST_SIMULATOR = $NEST_SIMULATOR" | |
| echo "NEST_INSTALL = $NEST_INSTALL" | |
| git clone --depth=1 https://github.com/nest/nest-simulator --branch ${{ matrix.nest_branch }} | |
| mkdir nest_install | |
| echo "NEST_INSTALL=$NEST_INSTALL" >> $GITHUB_ENV | |
| cd nest_install | |
| cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL $NEST_SIMULATOR | |
| make && make install | |
| cd .. | |
| # Install NESTML (repeated) | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| #echo PYTHONPATH=`pwd` >> $GITHUB_ENV | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| # Integration tests: prepare (make module containing all NESTML models) | |
| - name: Setup integration tests | |
| run: | | |
| # exclude third factor plasticity models; these will only compile successfully if code generation is as a neuron+synapse pair | |
| export ALL_MODEL_FILENAMES=`find models/neurons -name "*.nestml" | paste -sd " "` | |
| echo $ALL_MODEL_FILENAMES | |
| echo "NEST_INSTALL = ${{ env.NEST_INSTALL }}" | |
| echo "NEST_VERSION = ${{ matrix.nest_branch }}" | |
| sed -i 's|%NEST_PATH%|${{ env.NEST_INSTALL }}|' tests/nest_tests/resources/nest_codegen_opts.json | |
| sed -i 's|%NEST_VERSION%|${{ matrix.nest_branch }}|' tests/nest_tests/resources/nest_codegen_opts.json | |
| nestml --input_path $ALL_MODEL_FILENAMES --target_path target --suffix _nestml --logging_level INFO --module_name nestml_allmodels_module --codegen_opts tests/nest_tests/resources/nest_codegen_opts.json | |
| - name: Run integration tests | |
| if: ${{ matrix.nest_branch == 'master' || matrix.nest_branch == 'v2.20.2' }} | |
| env: | |
| LD_LIBRARY_PATH: ${{ env.NEST_INSTALL }}/lib/nest | |
| run: | | |
| rc=0 | |
| for fn in $GITHUB_WORKSPACE/tests/nest_tests/*.py; do | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1 | |
| done; | |
| exit $rc | |
| # Run only the nest integration tests for NEST versions other than master and 2.20.2 | |
| - name: Run integration tests | |
| if: ${{ !(matrix.nest_branch == 'master' || matrix.nest_branch == 'v2.20.2') }} | |
| env: | |
| LD_LIBRARY_PATH: ${{ env.NEST_INSTALL }}/lib/nest | |
| run: | | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" tests/nest_tests/nest_integration_test.py | |
| - name: Run Jupyter notebooks | |
| if: ${{ matrix.nest_branch == 'master' }} | |
| run: | | |
| ipynb_fns=$(find $GITHUB_WORKSPACE/doc/tutorials -name '*.ipynb') | |
| rc=0 | |
| for fn in $ipynb_fns; do | |
| echo "Now running Jupyter notebook: ${fn}" | |
| cd `dirname ${fn}` | |
| ipython3 ${fn} | |
| if [ $? -ne 0 ]; then | |
| echo "Error running Jupyter notebook: ${fn}" | |
| rc=1 | |
| fi | |
| done; | |
| cd $GITHUB_WORKSPACE | |
| exit $rc | |
| build_and_test_nest_compartmental: | |
| needs: [unit_tests] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| nest_branch: ["master"] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libltdl-dev libgsl0-dev libncurses5-dev libreadline6-dev pkg-config | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3 | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy pandas | |
| python -m pip install -r requirements.txt | |
| - name: Install NEST simulator | |
| run: | | |
| python -m pip install "cython<=3.0.10" | |
| echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE" | |
| NEST_SIMULATOR=$(pwd)/nest-simulator | |
| NEST_INSTALL=$(pwd)/nest_install | |
| echo "NEST_SIMULATOR = $NEST_SIMULATOR" | |
| echo "NEST_INSTALL = $NEST_INSTALL" | |
| git clone --depth=1 https://github.com/nest/nest-simulator --branch ${{ matrix.nest_branch }} | |
| mkdir nest_install | |
| echo "NEST_INSTALL=$NEST_INSTALL" >> $GITHUB_ENV | |
| cd nest_install | |
| cmake -DCMAKE_INSTALL_PREFIX=$NEST_INSTALL $NEST_SIMULATOR | |
| make && make install | |
| cd .. | |
| # Install NESTML (repeated) | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| #echo PYTHONPATH=`pwd` >> $GITHUB_ENV | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| - name: Run integration tests | |
| env: | |
| LD_LIBRARY_PATH: ${{ env.NEST_INSTALL }}/lib/nest | |
| run: | | |
| rc=0 | |
| for fn in $GITHUB_WORKSPACE/tests/nest_compartmental_tests/*.py; do | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1 | |
| done; | |
| exit $rc | |
| build_and_test_genn: | |
| needs: [unit_tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository contents | |
| uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Install apt dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libncurses5-dev pkg-config libffi-dev | |
| sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip pytest matplotlib scipy pybind11 psutil pkgconfig | |
| python -m pip install -r requirements.txt | |
| - name: Install GeNN | |
| run: | | |
| # XXX: using master branch due to fix from https://github.com/genn-team/genn/pull/676. We can switch back to latest GeNN release when a new version is released | |
| wget https://github.com/genn-team/genn/archive/master.zip -O genn-master.zip | |
| unzip genn-master.zip | |
| cd genn-master | |
| python setup.py install --user | |
| - name: Install NESTML | |
| run: | | |
| export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.9/site-packages | |
| echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
| python setup.py install | |
| - name: Run integration tests | |
| run: | | |
| rc=0 | |
| for fn in $GITHUB_WORKSPACE/tests/genn_tests/*.py; do | |
| pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1 | |
| done; | |
| exit $rc |