Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a complex workflow on Support scripts. #271

Merged
merged 15 commits into from
May 22, 2024
95 changes: 8 additions & 87 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,12 @@

name: Python Actions
on: [push]
env:
ROOT_PKG: spinn_utilities

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']

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: Run Install
uses: ./support/actions/run-install
- name: Test with pytest
uses: ./support/actions/pytest
with:
tests: unittests
coverage: ${{ matrix.python-version == 3.12 }}
cover-packages: ${{ env.ROOT_PKG }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}
env:
# Tests using ping won't work in Github Actions because of system config
SKIP_PING_TESTS: true

- name: Lint with flake8
run: flake8 $ROOT_PKG unittests
- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: ${{ env.ROOT_PKG }}
exitcheck: 31 # Action fails on any message
language: en_GB
rcfile: global_strict
- name: Lint with mypy
run: mypy $ROOT_PKG

validate:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: [3.12]

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: Setup
uses: ./support/actions/run-install

# Actual valiation steps
- 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
call:
uses: SpiNNakerManchester/SupportScripts/.github/workflows/python_checks.yml@main
with:
base-package: spinn_utilities
dependencies:
test_directories: unittests
flake8-packages: spinn_utilities unittests
secrets: inherit