Skip to content

Commit

Permalink
Merge pull request #520 from SpiNNakerManchester/setup-action-spy8
Browse files Browse the repository at this point in the history
Convert to use new actions
  • Loading branch information
dkfellows committed Dec 17, 2020
2 parents c9e5b95 + 4e30bca commit 3047874
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 202 deletions.
176 changes: 64 additions & 112 deletions .github/workflows/python_actions.yml
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
90 changes: 0 additions & 90 deletions .travis.yml

This file was deleted.

0 comments on commit 3047874

Please sign in to comment.