From fafa89f067b9f00d360ff4ba69d5f7acb93826fa Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 3 Jun 2024 15:27:58 +0100 Subject: [PATCH] coverage-package pylint_packages mypy-packages --- .github/workflows/python_checks.yml | 41 +++++++++++++++++------------ 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/python_checks.yml b/.github/workflows/python_checks.yml index 5207b3e..9330326 100644 --- a/.github/workflows/python_checks.yml +++ b/.github/workflows/python_checks.yml @@ -19,22 +19,11 @@ name: Python Actions on: workflow_call: inputs: - base-package: - description: > - The names of the base Python package. - Will be the one uses for coverage, plyint and mypy - required: true - type: string dependencies: description: > The list of SpiNNaker dependencies to check out. Space-separated required: true type: string - test_directories: - description: > - The list of directories to run pytest on. Space-seperated - required: true - type: string ubuntu_packages: description: > The names of the ubuntu packages to install @@ -42,6 +31,15 @@ on: required: false type: string default: '' + test_directories: + description: > + The list of directories to run pytest on. Space-seperated + required: true + type: string + coverage-package: + description: The names of the Python package to get coverage for + required: true + type: string flake8-packages: description: The names of the Python packages to run flake8 on. required: true @@ -67,11 +65,20 @@ on: default: global_strict # global_relaxed and global_strict will use files in support scripts # Any other value will be looked for in the calling repository + pylint-packages: + description: The names of the Python packages to run flake8 on. + required: true + type: string pylint_exitcheck: description: The combined results code to fail on required: false type: string default: "31" # Action fails on any message + mypy-packages: + description: The names of the Python packages to run flake8 on. + required: true + type: string + rat_config_file: description: > Which xml config file to use for rat. @@ -141,20 +148,20 @@ jobs: - name: Lint with pylint uses: SpiNNakerManchester/SupportScripts/actions/pylint@main with: - package: ${{ inputs.base-package }} + package: ${{ inputs.pylint-packages }} exitcheck: ${{ inputs.pylint_exitcheck }} rcfile: ${{ inputs.rcfile }} language: en_GB - name: Lint with mypy - run: mypy ${{ inputs.base-package }} + run: mypy ${{ inputs.mypy-packages }} - name: Test with pytest uses: SpiNNakerManchester/SupportScripts/actions/pytest@main with: tests: ${{ inputs.test_directories }} coverage: ${{ matrix.coverage == 'coverage' }} - cover-packages: ${{ inputs.base-package }} + cover-packages: ${{ inputs.coverage-package }} coveralls-token: ${{ secrets.GITHUB_TOKEN }} env: SPALLOC_USER: ${{ secrets.SPALLOC_USER }} @@ -206,14 +213,14 @@ jobs: if: ${{ matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true' }} uses: SpiNNakerManchester/SupportScripts/actions/pylint@main with: - package: ${{ inputs.base-package }} + package: ${{ inputs.coverage-package }} exitcheck: ${{ inputs.pylint_exitcheck }} rcfile: ${{ inputs.rcfile }} language: en_GB - name: Lint with mypy if: ${{ matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true' }} - run: mypy ${{ inputs.base-package }} + run: mypy ${{ inputs.pylint-packages }} - name: Test with pytest if: ${{ matrix.python-version != env.PRERELEASE || inputs.check_prereleases == 'true' }} @@ -221,7 +228,7 @@ jobs: with: tests: ${{ inputs.test_directories }} coverage: ${{ matrix.coverage == 'coverage' }} - cover-packages: ${{ inputs.base-package }} + cover-packages: ${{ inputs.coverage-package }} coveralls-token: ${{ secrets.GITHUB_TOKEN }} env: SPALLOC_USER: ${{ secrets.SPALLOC_USER }}