Skip to content

Commit

Permalink
make coverage and install optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jun 6, 2024
1 parent 5a8b912 commit 999bf97
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/python_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ on:
The list of SpiNNaker dependencies to check out. Space-separated
required: true
type: string
install_module:
description: >
Flag to say if the current model should be installed should be installed
Excepted values are true of false
required: false
type: string
default: 'true'
ubuntu_packages:
description: >
The names of the ubuntu packages to install
Expand All @@ -48,7 +55,7 @@ on:
description: Flag to say if prereleases python versions should be checked
required: false
type: string
default: 'true'
default: 'false'
cfg_file:
description: >
Name of the cfg file to be created
Expand Down Expand Up @@ -122,7 +129,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
install_dependencies: ${{ inputs.dependencies }}
install_module: true
install_module: ${{ inputs.install_module }}
install_check_tools: true
ubuntu_packages: ${{ inputs.ubuntu_packages }}
cfg_file: ${{ inputs.cfg_file }}
Expand Down Expand Up @@ -154,13 +161,14 @@ jobs:
language: en_GB

- name: Lint with mypy
if: ${{ inputs.mypy-packages != ''}}
run: mypy ${{ inputs.mypy-packages }}

- name: Test with pytest
uses: SpiNNakerManchester/SupportScripts/actions/pytest@main
with:
tests: ${{ inputs.test_directories }}
coverage: ${{ matrix.coverage == 'coverage' }}
coverage: ${{ matrix.coverage == 'coverage' && inputs.coverage-package != '' }}
cover-packages: ${{ inputs.coverage-package }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}
env:
Expand All @@ -180,7 +188,6 @@ jobs:

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

- runner: ubuntu-latest
python-version: "3.10"
Expand All @@ -200,7 +207,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
install_dependencies: ${{ inputs.dependencies }}
install_module: true
install_module: ${{ inputs.install_module }}
install_check_tools: true
ubuntu_packages: ${{ inputs.ubuntu_packages }}
cfg_file: ${{ inputs.cfg_file }}
Expand All @@ -219,17 +226,14 @@ jobs:
language: en_GB

- name: Lint with mypy
if: ${{ matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true' }}
if: ${{ (matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true') && inputs.mypy-packages != '' }}
run: mypy ${{ inputs.mypy-packages }}

- name: Test with pytest
if: ${{ matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true' }}
uses: SpiNNakerManchester/SupportScripts/actions/pytest@main
with:
tests: ${{ inputs.test_directories }}
coverage: ${{ matrix.coverage == 'coverage' }}
cover-packages: ${{ inputs.coverage-package }}
coveralls-token: ${{ secrets.GITHUB_TOKEN }}
env:
SPALLOC_USER: ${{ secrets.SPALLOC_USER }}
SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }}
Expand Down Expand Up @@ -265,7 +269,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
install_dependencies: ${{ inputs.dependencies }}
install_module: true
install_module: ${{ inputs.install_module }}
install_check_tools: false
# inputs.ubuntu_packages NOT installed!
cfg_file: ${{ inputs.cfg_file }}
Expand Down

0 comments on commit 999bf97

Please sign in to comment.