Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into test
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/python_checks.yml
  • Loading branch information
Christian-B committed May 28, 2024
2 parents fd1b43b + c46b9e8 commit cba5d7f
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 2 deletions.
160 changes: 158 additions & 2 deletions .github/workflows/python_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,118 @@ on:
type: string

jobs:
validate:
# Everything as checks but do validation steps first
strategy:
matrix:
include:
- runner: ubuntu-latest
python-version: "3.12"
checks: 'validate'
runs-on: ${{ matrix.runner }}
timeout-minutes: 20

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

- name: Checkout
uses: actions/checkout@v4

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

- name: Install pip, etc
uses: ./support/actions/python-tools

- name: Install mypy
run: pip install mypy

- name: Install Spinnaker Dependencies
uses: ./support/actions/install-spinn-deps
with:
repositories: ${{ inputs.dependencies }}
install: true

- name: Run Install
uses: ./support/actions/run-install

- name: Run rat copyright enforcement
uses: ./support/actions/check-copyrights
with:
config_file: rat_asl20.xml

- name: Build documentation with sphinx
uses: ./support/actions/sphinx
with:
directory: doc/source

- name: Validate CITATION.cff
uses: dieghernan/cff-validator@main

- name: Lint with flake8
run: flake8 ${{ inputs.flake8-packages }}

- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: ${{ inputs.base-package }}
exitcheck: 31 # Action fails on any message
language: en_GB
rcfile: global_strict

- name: Lint with mypy
run: mypy ${{ inputs.base-package }}

- name: Test with pytest
uses: ./support/actions/pytest
with:
tests: ${{ inputs.test_directories }}
coverage: ${{ matrix.coverage == 'coverage' }}
cover-packages: ${{ inputs.base-package }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}
env:
SPALLOC_USER: ${{ secrets.SPALLOC_USER }}
SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }}
# Tests using ping won't work in Github Actions because of system config
SKIP_PING_TESTS: true

checks:
# Everything as tests but do validation steps first
strategy:
matrix:
include:
# prereleases
- runner: ubuntu-24.04
python-version: "3.13"

- runner: ubuntu-latest
python-version: "3.11"
coverage: 'coverage'

- runner: ubuntu-latest
python-version: "3.10"

- runner: ubuntu-22.04
python-version: 3.9

- runner: ubuntu-20.04
python-version: 3.8

runs-on: ${{ matrix.runner }}
timeout-minutes: 5
timeout-minutes: 20

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.python-version == 3.13 }}

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -99,7 +195,67 @@ jobs:
- name: Test with pytest
uses: ./support/actions/pytest
with:
tests: ${{ inputs.stest_directories }}
tests: ${{ inputs.test_directories }}
coverage: ${{ matrix.coverage == 'coverage' }}
cover-packages: ${{ inputs.base-package }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}
env:
SPALLOC_USER: ${{ secrets.SPALLOC_USER }}
SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }}
# Tests using ping won't work in Github Actions because of system config
SKIP_PING_TESTS: true

tests:
strategy:
matrix:
include:
- runner: windows-latest
python-version: "3.12"
checks: 'tests'

- runner: windows-2019
python-version: 3.8
checks: 'tests'

- runner: macos-latest
python-version: "3.12"
checks: 'tests'

- runner: macos-11
python-version: 3.8
checks: 'tests'

runs-on: ${{ matrix.runner }}
timeout-minutes: 20

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

- name: Checkout
uses: actions/checkout@v4

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

- name: Install Spinnaker Dependencies
uses: ./support/actions/install-spinn-deps
with:
repositories: ${{ inputs.dependencies }}
install: true

- name: Run Install
uses: ./support/actions/run-install

- name: Test with pytest
env:
SPALLOC_USER: ${{ secrets.SPALLOC_USER }}
SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }}
# Tests using ping won't work in Github Actions because of system config
SKIP_PING_TESTS: true
run: pytest ${{ inputs.test_directories }}
6 changes: 6 additions & 0 deletions actions/python-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ name: "Install Advanced Python Tools"
description: >
Installs tooling to support advanced Python testing.
inputs:
check_tools:
description: Install the checking tools
required: false
default: install
pylint-version:
description: The version of pylint desired
required: false
Expand All @@ -39,6 +43,7 @@ runs:
using: composite
steps:
- name: Install spell checker
if: ${{ inputs.check_tools == 'install' }}
shell: bash
run: source $SUPPORT_DIR/setup-spell.bash
env:
Expand All @@ -51,6 +56,7 @@ runs:
shell: bash
run: python -m pip install pip
- name: Install extended Python tooling
if: ${{ inputs.check_tools == 'install'}}
shell: bash
run: |
pip install flake8 "pylint $PYLINT_VERSION" pyenchant
Expand Down

0 comments on commit cba5d7f

Please sign in to comment.