mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
Documented CheckDocumentation.
This commit is contained in:
5
.github/workflows/CheckDocumentation.yml
vendored
5
.github/workflows/CheckDocumentation.yml
vendored
@@ -41,7 +41,7 @@ on:
|
|||||||
fail_under:
|
fail_under:
|
||||||
description: 'Minimum required documentation coverage level'
|
description: 'Minimum required documentation coverage level'
|
||||||
required: false
|
required: false
|
||||||
default: 80
|
default: '80'
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python_version }}
|
python-version: ${{ inputs.python_version }}
|
||||||
|
|
||||||
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
- name: 🔧 Install docstr_coverage and interrogate dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --disable-pip-version-check -U docstr_coverage interrogate[png]
|
python -m pip install --disable-pip-version-check -U docstr_coverage interrogate[png]
|
||||||
|
|
||||||
@@ -80,4 +80,3 @@ jobs:
|
|||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
printf "%s\n" "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})"
|
printf "%s\n" "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -191,6 +191,14 @@ It can be used for simple Python packages as well as namespace packages.
|
|||||||
|
|
||||||
* :ref:`pyTooling/Actions/.github/workflows/ApplicationTesting.yml <JOBTMPL/ApplicationTesting>`
|
* :ref:`pyTooling/Actions/.github/workflows/ApplicationTesting.yml <JOBTMPL/ApplicationTesting>`
|
||||||
* :ref:`pyTooling/Actions/.github/workflows/CheckDocumentation.yml <JOBTMPL/CheckDocumentation>`
|
* :ref:`pyTooling/Actions/.github/workflows/CheckDocumentation.yml <JOBTMPL/CheckDocumentation>`
|
||||||
|
|
||||||
|
* :gh:`actions/checkout`
|
||||||
|
* :gh:`actions/setup-python`
|
||||||
|
* pip
|
||||||
|
|
||||||
|
* :pypi:`docstr_coverage`
|
||||||
|
* :pypi:`interrogate`
|
||||||
|
|
||||||
* :ref:`pyTooling/Actions/.github/workflows/StaticTypeCheck.yml <JOBTMPL/StaticTypeCheck>`
|
* :ref:`pyTooling/Actions/.github/workflows/StaticTypeCheck.yml <JOBTMPL/StaticTypeCheck>`
|
||||||
* :ref:`pyTooling/Actions/.github/workflows/Package.yml <JOBTMPL/Package>`
|
* :ref:`pyTooling/Actions/.github/workflows/Package.yml <JOBTMPL/Package>`
|
||||||
|
|
||||||
|
|||||||
@@ -161,9 +161,7 @@ python_version
|
|||||||
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
||||||
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
||||||
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
||||||
:Description: Python version used as default for other jobs requiring a single Python version. |br|
|
:Description: Python version used to run Python code in this job.
|
||||||
In case :ref:`JOBTMPL/Parameters/Input/python_version_list` is an empty string, this version is used
|
|
||||||
to populate the version list.
|
|
||||||
|
|
||||||
|
|
||||||
.. _JOBTMPL/SphinxDocumentation/Input/requirements:
|
.. _JOBTMPL/SphinxDocumentation/Input/requirements:
|
||||||
|
|||||||
@@ -145,9 +145,7 @@ python_version
|
|||||||
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
||||||
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
||||||
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
||||||
:Description: Python version used as default for other jobs requiring a single Python version. |br|
|
:Description: Python version used to run Python code in this job.
|
||||||
In case :ref:`JOBTMPL/Parameters/Input/python_version_list` is an empty string, this version is used
|
|
||||||
to populate the version list.
|
|
||||||
|
|
||||||
|
|
||||||
.. _JOBTMPL/Package/Input/requirements:
|
.. _JOBTMPL/Package/Input/requirements:
|
||||||
|
|||||||
@@ -167,9 +167,7 @@ python_version
|
|||||||
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
||||||
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
||||||
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
||||||
:Description: Python version used as default for other jobs requiring a single Python version. |br|
|
:Description: Python version used to run Python code in this job.
|
||||||
In case :ref:`JOBTMPL/Parameters/Input/python_version_list` is an empty string, this version is used
|
|
||||||
to populate the version list.
|
|
||||||
|
|
||||||
|
|
||||||
.. _JOBTMPL/PublishOnPyPI/Input/requirements:
|
.. _JOBTMPL/PublishOnPyPI/Input/requirements:
|
||||||
|
|||||||
@@ -3,20 +3,173 @@
|
|||||||
CheckDocumentation
|
CheckDocumentation
|
||||||
##################
|
##################
|
||||||
|
|
||||||
.. todo:: CheckDocumentation:Needs documentation.
|
The ``CheckDocumentation`` job checks the level of documentation coverage for Python files.
|
||||||
|
|
||||||
**Behavior:**
|
.. topic:: Features
|
||||||
|
|
||||||
.. todo:: CheckDocumentation:Behavior needs documentation.
|
* Check documentation coverage in Python code using :pypi:`docstr_coverage`.
|
||||||
|
* Check documentation coverage in Python code using :pypi:`interrogate`.
|
||||||
|
|
||||||
**Dependencies:**
|
.. topic:: Behavior
|
||||||
|
|
||||||
.. todo:: CheckDocumentation:Dependencies needs documentation.
|
1. Checkout repository.
|
||||||
|
2. Setup Python environment and install dependencies.
|
||||||
|
3. Run ``docstr_coverage``.
|
||||||
|
3. Run ``interrogate``.
|
||||||
|
|
||||||
|
.. topic:: Job Execution
|
||||||
|
|
||||||
|
.. image:: ../../_static/pyTooling-Actions-CheckDocumentation.png
|
||||||
|
:width: 600px
|
||||||
|
|
||||||
|
.. topic:: Dependencies
|
||||||
|
|
||||||
|
* :gh:`actions/checkout`
|
||||||
|
* :gh:`actions/setup-python`
|
||||||
|
* pip
|
||||||
|
|
||||||
|
* :pypi:`docstr_coverage`
|
||||||
|
* :pypi:`interrogate`
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Instantiation:
|
||||||
|
|
||||||
Instantiation
|
Instantiation
|
||||||
*************
|
*************
|
||||||
|
|
||||||
Simple Example
|
The following instantiation example creates a ``Params`` job derived from job template ``Parameters`` version ``@r5``. It only
|
||||||
|
requires a `name` parameter to create the artifact names.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
name: Pipeline
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ConfigParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
|
||||||
|
with:
|
||||||
|
package_name: myPackage
|
||||||
|
|
||||||
|
DocCoverage:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r5
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
with:
|
||||||
|
directory: ${{ needs.ConfigParams.outputs.package_directory }}
|
||||||
|
|
||||||
|
|
||||||
|
.. seealso::
|
||||||
|
|
||||||
|
:ref:`JOBTMPL/ConfigParams`
|
||||||
|
``ConfigParams`` is usualy
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Parameters:
|
||||||
|
|
||||||
|
Parameter Summary
|
||||||
|
*****************
|
||||||
|
|
||||||
|
.. rubric:: Goto :ref:`input parameters <JOBTMPL/CheckDocumentation/Inputs>`
|
||||||
|
|
||||||
|
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
|
||||||
|
| Parameter Name | Required | Type | Default |
|
||||||
|
+=========================================================================+==========+==========+===================================================================+
|
||||||
|
| :ref:`JOBTMPL/CheckDocumentation/Input/ubuntu_image_version` | no | string | ``'24.04'`` |
|
||||||
|
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
|
||||||
|
| :ref:`JOBTMPL/CheckDocumentation/Input/python_version` | no | string | ``'3.13'`` |
|
||||||
|
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
|
||||||
|
| :ref:`JOBTMPL/CheckDocumentation/Input/directory` | yes | string | — — — — |
|
||||||
|
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
|
||||||
|
| :ref:`JOBTMPL/CheckDocumentation/Input/fail_under` | no | string | ``'80'`` |
|
||||||
|
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
|
||||||
|
|
||||||
|
.. rubric:: Goto :ref:`secrets <JOBTMPL/CheckDocumentation/Secrets>`
|
||||||
|
|
||||||
|
This job template needs no secrets.
|
||||||
|
|
||||||
|
.. rubric:: Goto :ref:`output parameters <JOBTMPL/CheckDocumentation/Outputs>`
|
||||||
|
|
||||||
|
This job template has no output parameters.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Inputs:
|
||||||
|
|
||||||
|
Input Parameters
|
||||||
|
****************
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Input/ubuntu_image_version:
|
||||||
|
|
||||||
|
ubuntu_image_version
|
||||||
|
====================
|
||||||
|
|
||||||
|
:Type: string
|
||||||
|
:Required: no
|
||||||
|
:Default Value: ``'24.04'``
|
||||||
|
:Possible Values: See `actions/runner-images - Available Images <https://github.com/actions/runner-images?tab=readme-ov-file#available-images>`__
|
||||||
|
for available Ubuntu image versions.
|
||||||
|
:Description: Version of the Ubuntu image used to run this job.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Unfortunately, GitHub Actions has only a `limited set of functions <https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#functions>`__,
|
||||||
|
thus, the usual Ubuntu image name like ``'ubuntu-24.04'`` can't be split into image name and image
|
||||||
|
version.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Input/python_version:
|
||||||
|
|
||||||
|
python_version
|
||||||
==============
|
==============
|
||||||
|
|
||||||
.. todo:: CheckDocumentation:Simple example needs documentation.
|
:Type: string
|
||||||
|
:Required: no
|
||||||
|
:Default Value: ``'3.13'``
|
||||||
|
:Possible Values: Any valid Python version conforming to the pattern ``<major>.<minor>`` or ``pypy-<major>.<minor>``. |br|
|
||||||
|
See `actions/python-versions - available Python versions <https://github.com/actions/python-versions>`__
|
||||||
|
and `actions/setup-python - configurable Python versions <https://github.com/actions/setup-python>`__.
|
||||||
|
:Description: Python version used to run Python code in this job.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Input/directory:
|
||||||
|
|
||||||
|
directory
|
||||||
|
=========
|
||||||
|
|
||||||
|
:Type: string
|
||||||
|
:Required: yes
|
||||||
|
:Default Value: — — — —
|
||||||
|
:Possible Values: Any valid directory or sub-directory.
|
||||||
|
:Description: Directory where the Python code is located.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Input/fail_under:
|
||||||
|
|
||||||
|
fail_under
|
||||||
|
==========
|
||||||
|
|
||||||
|
:Type: string
|
||||||
|
:Required: no
|
||||||
|
:Default Value: ``'80'``
|
||||||
|
:Possible Values: Any valid percentage from 0 to 100 encoded as string.
|
||||||
|
:Description: A minimum percentage level for good documentation. If the documentation coverage is below this level,
|
||||||
|
the coverage is considered a fail.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Secrets:
|
||||||
|
|
||||||
|
Secrets
|
||||||
|
*******
|
||||||
|
|
||||||
|
This job template needs no secrets.
|
||||||
|
|
||||||
|
|
||||||
|
.. _JOBTMPL/CheckDocumentation/Outputs:
|
||||||
|
|
||||||
|
Outputs
|
||||||
|
*******
|
||||||
|
|
||||||
|
This job template has no output parameters.
|
||||||
|
|||||||
BIN
doc/_static/pyTooling-Actions-CheckDocumentation.png
vendored
Normal file
BIN
doc/_static/pyTooling-Actions-CheckDocumentation.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
Reference in New Issue
Block a user