Skip to content

Commit

Permalink
Merge pull request #51 from SpiNNakerManchester/action
Browse files Browse the repository at this point in the history
Convert the CI flow to a Github Action
  • Loading branch information
andrewgait committed Nov 9, 2020
2 parents 1b7c6da + 0ee7238 commit 186b9fc
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 70 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copyright (c) 2020 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 <http://www.gnu.org/licenses/>.

# This workflow will install Python dependencies, run tests, lint and rat with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.6, 3.7, 3.8]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout
uses: actions/checkout@v2
- name: Checkout SupportScripts
uses: actions/checkout@v2
with:
repository: SpiNNakerManchester/SupportScripts
path: support

- name: Checkout SpiNNaker dependencies
run: |
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNUtils.git
- name: Install pip and code quality tools
run: |
python -m pip install --upgrade pip
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
run: |
python setup.py develop
pip install -r requirements-test.txt
- name: Test with pytest and coverage
if: matrix.python-version == 3.6
run: |
py.test tests/ --cov spalloc --cov tests --durations=10 --timeout=120
- name: Test with pytest
if: matrix.python-version != 3.6
run: |
py.test tests/ --durations=10 --timeout=120
- name: Lint with flake8
run: |
flake8 spalloc tests
- name: Lint with pylint
# Note that there's special conditioning of the return code of pylint
run: |
pylint --output-format=colorized --disable=R,C spalloc || exit $(($? & 35))
- name: Run rat copyright enforcement
if: matrix.python-version == 3.6
run: |
support/rat.sh download
support/rat.sh run
- name: Build documentation with sphinx
if: matrix.python-version == 3.6
run: |
pip install -r requirements-docs.txt
cd docs/source
sphinx-build -W -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html
- 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ target/

# Hidden files
.*
!.github

# Virtualenv nonsense
pip-selfcheck.json
1 change: 1 addition & 0 deletions .ratexcludes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/SpiNNUtils/**
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Spalloc: SpiNNaker machine allocation client
.. image:: https://readthedocs.org/projects/spalloc/badge/?version=stable
:alt: Documentation
:target: http://spalloc.readthedocs.org/
.. image:: https://travis-ci.org/SpiNNakerManchester/spalloc.svg?branch=master
.. image:: https://github.com/SpiNNakerManchester/spalloc/workflows/Python%20Build/badge.svg?branch=master
:alt: Build Status
:target: https://travis-ci.org/SpiNNakerManchester/spalloc
:target: https://github.com/SpiNNakerManchester/spalloc/actions?query=workflow%3A%22Python+Build%22+branch%3Amaster
.. image:: https://coveralls.io/repos/SpiNNakerManchester/spalloc/badge.svg?branch=master
:alt: Coverage Status
:target: https://coveralls.io/r/SpiNNakerManchester/spalloc?branch=master
Expand Down
10 changes: 5 additions & 5 deletions spalloc/scripts/alloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
.. note::
By default, allocated machines are powered on but not booted. If Rig_ is
installed, ``spalloc`` provides a ``--boot`` option which also boots the
allocated machine once it has been powered on.
By default, allocated machines are powered on but not booted. If
`Rig <https://github.com/project-rig/rig>`__
is installed, ``spalloc`` provides a ``--boot`` option which also boots
the allocated machine once it has been powered on. This dependency can be
installed using the ``[boot]`` option at install time for spalloc.
.. image:: _static/spalloc.gif
:alt: Animated GIF showing the typical execution of a spalloc call.
Expand All @@ -50,8 +52,6 @@
``spalloc 3 4 0`` A single SpiNN-5 board at logical position (3, 4, 0)
===================== ====================================================
.. _Rig: https://github.com/project-rig/rig
A range of additional command-line arguments are available to control various
aspects of Job allocation, run ``spalloc --help`` for a complete listing.
Expand Down

0 comments on commit 186b9fc

Please sign in to comment.