diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index bd76b0003..3ceacd8a7 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -19,9 +19,10 @@ name: Python Actions on: [push] -# Magic to make matplotlib behave nicely env: - MPLBACKEND: module://matplotlib.backends.backend_agg + # Magic to make matplotlib behave nicely + MPLBACKEND: module://matplotlib.backends.backend_agg + BLESSED_PY: 3.6 jobs: build: @@ -35,7 +36,6 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Checkout uses: actions/checkout@v2 - name: Checkout SupportScripts @@ -44,124 +44,76 @@ jobs: repository: SpiNNakerManchester/SupportScripts path: support - - name: Checkout Spinnaker Dependencies - run: | - support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNUtils.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNMachine.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNMan.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/PACMAN.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/DataSpecification.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/spalloc.git - support/gitclone2.sh git://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/sPyNNaker.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/IntroLab.git - support/gitclone2.sh https://github.com/SpiNNakerManchester/PyNN8Examples.git - - - name: Install -pip - run: | - python -m pip install --upgrade pip setuptools wheel - pip install 'pylint<2.5' python-coveralls 'coverage>=4.4,<5.0' - - - name: Install SpiNNUtils - run: python setup.py install - working-directory: SpiNNUtils - - - name: Install SpiNNMachine - run: python setup.py install - working-directory: SpiNNMachine - - - name: Install SpiNNMan - run: python setup.py install - working-directory: SpiNNMan - - - name: Preinstall pacman requirements (2.7 Only) - if: matrix.python-version == 2.7 - run: pip install -r requirements.txt - working-directory: PACMAN - - - name: Install PACMAN - run: python setup.py install - working-directory: PACMAN - - - name: Install DataSpecification - run: python setup.py install - working-directory: DataSpecification - - - name: Install spalloc - run: python setup.py install - working-directory: spalloc - - - name: Preinstall SpiNNFrontEndCommon requirements (2.7 Only) - if: matrix.python-version == 2.7 - run: pip install -r requirements.txt - working-directory: SpiNNFrontEndCommon - - - name: Install SpiNNFrontEndCommon - run: python setup.py install - working-directory: SpiNNFrontEndCommon - - - name: Preinstall sPyNNaker requirements (2.7 Only) - if: matrix.python-version == 2.7 - run: pip install -r requirements.txt - working-directory: sPyNNaker - - - name: Install sPyNNaker - run: python setup.py install - working-directory: sPyNNaker - - - name: Preinstall requirements-test (2.7 Only) - if: matrix.python-version == 2.7 - run: pip install -r requirements.txt - + - name: Install pip, etc + uses: ./support/actions/python-tools + - name: Install Spinnaker Dependencies + uses: ./support/actions/checkout-spinn-deps + with: + repositories: > + SpiNNUtils SpiNNMachine SpiNNMan PACMAN DataSpecification spalloc + SpiNNFrontEndCommon sPyNNaker + install: true + preinstall: ${{ matrix.python-version == 2.7 }} - name: Setup - run: python setup.py develop - - - name: Install requirements-test - run: pip install -r requirements-test.txt + uses: ./support/actions/run-setup + with: + preinstall: ${{ matrix.python-version == 2.7 }} + - name: Checkout Spinnaker Test Cases + uses: ./support/actions/checkout-spinn-deps + with: + repositories: IntroLab PyNN8Examples - name: Create a spynnaker.cfg - run: | - echo '[Machine]' > ~/.spynnaker.cfg - echo "machineName = $SPINNAKER_BOARD_ADDRESS" >> ~/.spynnaker.cfg - echo "version = $SPINNAKER_BOARD_VERSION" >> ~/.spynnaker.cfg - echo '[Database]' >> ~/.spynnaker.cfg - echo '[Simulation]' >> ~/.spynnaker.cfg - echo '[Buffers]' >> ~/.spynnaker.cfg - env: - SPINNAKER_BOARD_ADDRESS: spinn-4.cs.man.ac.uk - SPINNAKER_BOARD_VERSION: 5 + uses: ./support/actions/configure-spynnaker + with: + board-address: spinn-4.cs.man.ac.uk + - name: Test with pytest + uses: ./support/actions/pytest + with: + tests: unittests + coverage: ${{ matrix.python-version == env.BLESSED_PY }} + cover-packages: spynnaker8 + coveralls-token: ${{ secrets.COVERALLS_REPO_TOKEN }} - - name: Test with pytest and coverage - if: matrix.python-version == 3.6 - run: pytest unittests --cov spynnaker8 + validate: + runs-on: ubuntu-latest + steps: + - name: Set up Python ${{ env.BLESSED_PY }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.BLESSED_PY }} + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout SupportScripts + uses: actions/checkout@v2 + with: + repository: SpiNNakerManchester/SupportScripts + path: support - - name: Test with pytest - if: matrix.python-version != 3.6 - run: pytest unittests + - name: Install pip, etc + uses: ./support/actions/python-tools + - name: Install Spinnaker Dependencies + uses: ./support/actions/checkout-spinn-deps + with: + repositories: > + SpiNNUtils SpiNNMachine SpiNNMan PACMAN DataSpecification spalloc + SpiNNFrontEndCommon sPyNNaker + install: true + - name: Setup + uses: ./support/actions/run-setup - name: Lint with flake8 run: flake8 spynnaker8 unittests - - name: Lint with pylint - # Note that there's special conditioning of the return code of pylint - run: | - pylint --output-format=colorized --disable=R,C spynnaker8 || exit $(($? & 35)) + uses: ./support/actions/pylint + with: + package: spynnaker8 - name: Run rat copyright enforcement - if: matrix.python-version == 3.6 - run: | - support/rat.sh download - support/rat.sh run - + if: matrix.python-version == env.BLESSED_PY + uses: ./support/actions/check-copyrights - name: Build documentation with sphinx - if: matrix.python-version == 3.6 - run: sphinx-build -W -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html - working-directory: doc/source - - - name: Run coveralls and report coverage - if: matrix.python-version == 3.6 - env: - COVERALLS_SERVICE_NAME: 'GitHub CI' - COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }} - NODE_COVERALLS_DEBUG: 1 - run: coveralls + if: matrix.python-version == env.BLESSED_PY + uses: ./support/actions/sphinx + with: + directory: doc/source diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index de2cf2d31..000000000 --- a/.travis.yml +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) 2017-2019 The University of Manchester -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -language: python -os: linux -jobs: - include: - - name: Py3.6 - python: 3.6 - dist: bionic - - name: Py3.7 - python: 3.7 - dist: focal - - name: Py3.8 - python: 3.8 - dist: focal - - name: Py2.7 (legacy) - python: 2.7 - dist: xenial -cache: pip -env: - - MPLBACKEND=module://matplotlib.backends.backend_agg -addons: - apt: - packages: - - openjdk-8-jre-headless - - ant - -before_install: - # Work around ludicrous Travis bug - - git clone https://github.com/SpiNNakerManchester/SupportScripts.git support - - python support/travis_blocking_stdout.py - - support/rat.sh download - # Bring pip up to date - - pip install --upgrade pip setuptools wheel - - pip install --only-binary=numpy,scipy,matplotlib numpy scipy matplotlib - # SpiNNakerManchester internal dependencies; development mode - - support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNUtils.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNMachine.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNMan.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/PACMAN.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/DataSpecification.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/spalloc.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNFrontEndCommon.git - - support/pipinstall.sh git://github.com/SpiNNakerManchester/sPyNNaker.git - - support/gitclone.sh https://github.com/SpiNNakerManchester/IntroLab.git - - support/gitclone.sh https://github.com/SpiNNakerManchester/PyNN8Examples.git - -install: - - pip install -r requirements-test.txt - - pip install 'pylint<2.5' python-coveralls 'coverage>=4.4,<5.0' - - python ./setup.py install - -before_script: - - echo '[Machine]' > ~/.spynnaker.cfg - - echo "machineName = $SPINNAKER_BOARD_ADDRESS" >> ~/.spynnaker.cfg - - echo "version = ${SPINNAKER_BOARD_VERSION:-5}" >> ~/.spynnaker.cfg - - echo '[Database]' >> ~/.spynnaker.cfg - - echo '[Simulation]' >> ~/.spynnaker.cfg - - echo '[Buffers]' >> ~/.spynnaker.cfg - -script: - # Tests - - py.test --cov-report= unittests --cov spynnaker8 - # Code quality checks - - flake8 spynnaker8 unittests p8_integration_tests - - ( pylint --output-format=colorized --disable=R,C spynnaker8; exit $(($? & 35)) ) - # Copyright check - - support/rat.sh run - # Doc check - - cd doc/source - - sphinx-build -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html - - sphinx-build -T -b json -d _build/doctrees-json -D language=en . _build/json - - sphinx-build -T -b singlehtml -d _build/doctrees-readthedocssinglehtmllocalmedia -D language=en . _build/localmedia - -after_success: - - cd $TRAVIS_BUILD_DIR - - COVERALLS_PARALLEL=true coveralls