Documented StaticTypeCheck.

This commit is contained in:
Patrick Lehmann
2025-09-12 00:16:02 +02:00
parent d1d591efb8
commit 250ad53b7b
3 changed files with 127 additions and 58 deletions

View File

@@ -56,7 +56,8 @@ on:
type: string type: string
html_artifact: html_artifact:
description: 'Name of the typing artifact (HTML report).' description: 'Name of the typing artifact (HTML report).'
required: true required: false
default: ''
type: string type: string
junit_artifact: junit_artifact:
description: 'Name of the typing junit artifact (junit XML).' description: 'Name of the typing junit artifact (junit XML).'
@@ -65,7 +66,6 @@ on:
type: string type: string
jobs: jobs:
StaticTypeCheck: StaticTypeCheck:
name: 👀 Check Static Typing using Python ${{ inputs.python_version }} name: 👀 Check Static Typing using Python ${{ inputs.python_version }}
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"

View File

@@ -6,19 +6,37 @@ StaticTypeCheck
This job runs a static type check using mypy and collects the results. These results can be converted to a HTML report This job runs a static type check using mypy and collects the results. These results can be converted to a HTML report
and then uploaded as an artifact. and then uploaded as an artifact.
**Behavior:** .. topic:: Features
* tbd
.. topic:: Behavior
1. Checkout repository 1. Checkout repository
2. Setup Python and install dependencies 2. Setup Python and install dependencies
3. Run type checking command(s). 3. Run type checking command(s).
4. Upload type checking report as an artifact 4. Upload type checking report as an artifact
**Dependencies:** .. topic:: Job Execution
.. image:: ../../_static/pyTooling-Actions-StaticTypeCheck.png
:width: 1000px
.. topic:: Dependencies
* :gh:`actions/checkout` * :gh:`actions/checkout`
* :gh:`actions/setup-python` * :gh:`actions/setup-python`
* pip
* Python packages specified via :ref:`JOBTMPL/StaticTypeCheck/Input/requirements`.
* :gh:`pyTooling/upload-artifact`
* :gh:`actions/upload-artifact` * :gh:`actions/upload-artifact`
.. _JOBTMPL/StaticTypeCheck/Instantiation:
Instantiation Instantiation
************* *************
@@ -83,92 +101,133 @@ Example ``commands``:
cd Parent cd Parent
mypy --html-report ../htmlmypy -p ToolName mypy --html-report ../htmlmypy -p ToolName
Parameters
**********
python_version .. _JOBTMPL/StaticTypeCheck/Parameters:
==============
+----------------+----------+----------+-----------------+ Parameter Summary
*****************
.. rubric:: Goto :ref:`input parameters <JOBTMPL/StaticTypeCheck/Inputs>`
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| Parameter Name | Required | Type | Default | | Parameter Name | Required | Type | Default |
+================+==========+==========+=================+ +=====================================================================+==========+==========+===================================================================+
| python_version | optional | string | ``3.11`` | | :ref:`JOBTMPL/StaticTypeCheck/Input/ubuntu_image_version` | no | string | ``'24.04'`` |
+----------------+----------+----------+-----------------+ +---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/python_version` | no | string | ``'3.13'`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/requirements` | no | string | ``'-r tests/requirements.txt'`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/commands` | yes | string | — — — — |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/html_report` | no | string | ``'htmlmypy'`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/junit_report` | no | string | ``'StaticTypingSummary.xml'`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/html_artifact` | no | string | ``''`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/StaticTypeCheck/Input/junit_artifact` | no | string | ``''`` |
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
Python version. .. rubric:: Goto :ref:`secrets <JOBTMPL/StaticTypeCheck/Secrets>`
This job template needs no secrets.
.. rubric:: Goto :ref:`output parameters <JOBTMPL/StaticTypeCheck/Outputs>`
This job template has no output parameters.
.. _JOBTMPL/StaticTypeCheck/Inputs:
Input Parameters
****************
.. _JOBTMPL/StaticTypeCheck/Input/ubuntu_image_version:
.. include:: ../_ubuntu_image_version.rst
.. _JOBTMPL/StaticTypeCheck/Input/python_version:
.. include:: ../_python_version.rst
.. _JOBTMPL/StaticTypeCheck/Input/requirements:
requirements requirements
============ ============
+----------------+----------+----------+-------------------------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: no
+================+==========+==========+===============================+ :Default Value: ``'-r tests/requirements.txt'``
| requirements | optional | string | ``-r tests/requirements.txt`` | :Possible Values: Any valid list of parameters for ``pip install``. |br|
+----------------+----------+----------+-------------------------------+ Either a requirements file can be referenced using ``'-r path/to/requirements.txt'``, or a list of
packages can be specified using a space separated list like ``'mypy lxml'``.
:Description: Python dependencies to be installed through *pip*.
Python dependencies to be installed through pip.
.. _JOBTMPL/StaticTypeCheck/Input/commands:
commands commands
======== ========
+----------------+----------+----------+--------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: yes
+================+==========+==========+==============+ :Default Value: — — — —
| commands | yes | string | — — — — | :Possible Values: tbd
+----------------+----------+----------+--------------+ :Description: tbd
Commands to run the static type checks.
.. _JOBTMPL/StaticTypeCheck/Input/html_report:
html_report html_report
=========== ===========
+----------------+----------+----------+-----------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: no
+================+==========+==========+=================+ :Default Value: ``'htmlmypy'``
| report | optional | string | ``htmlmypy`` | :Possible Values: Any valid directory or subdirectory path.
+----------------+----------+----------+-----------------+ :Description: The directory containing the generated HTML report.
HTML output directory to upload as an artifact.
.. _JOBTMPL/StaticTypeCheck/Input/junit_report:
junit_report junit_report
============ ============
+----------------+----------+----------+-----------------------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: no
+================+==========+==========+=============================+ :Default Value: ``'StaticTypingSummary.xml'``
| report | optional | string | ``StaticTypingSummary.xml`` | :Possible Values: Any valid file name for mypy's JUnit XML report.
+----------------+----------+----------+-----------------------------+ :Description: File name for the JUnit XML file.
junit file to upload as an artifact.
.. _JOBTMPL/StaticTypeCheck/Input/html_artifact:
html_artifact html_artifact
============= =============
+----------------+----------+----------+--------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: no
+================+==========+==========+==============+ :Default Value: ``''``
| html_artifact | yes | string | — — — — | :Possible Values: Any valid artifact name.
+----------------+----------+----------+--------------+ :Description: Name of the artifact containing the HTML report.
Name of the typing artifact (HTML report).
.. _JOBTMPL/StaticTypeCheck/Input/junit_artifact:
junit_artifact junit_artifact
============== ==============
+----------------+----------+----------+--------------+ :Type: string
| Parameter Name | Required | Type | Default | :Required: no
+================+==========+==========+==============+ :Default Value: ``''``
| junit_artifact | optional | string | ``""`` | :Possible Values: Any valid artifact name.
+----------------+----------+----------+--------------+ :Description: Name of the artifact containing the JUnit XML report.
Name of the typing junit artifact (junit XML).
.. _JOBTMPL/StaticTypeCheck/Secrets:
Secrets Secrets
******* *******
@@ -176,7 +235,17 @@ Secrets
This job template needs no secrets. This job template needs no secrets.
Results .. _JOBTMPL/StaticTypeCheck/Outputs:
Outputs
******* *******
This job template has no output parameters. This job template has no output parameters.
.. _JOBTMPL/StaticTypeCheck/Optimizations:
Optimizations
*************
This template offers no optimizations (reduced job runtime).

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB