Also use JSON objects for SphinxDocumentation.

This commit is contained in:
Patrick Lehmann
2025-09-24 00:17:43 +02:00
parent 91736df13e
commit 53a32fbf35
11 changed files with 125 additions and 104 deletions

View File

@@ -301,12 +301,12 @@ jobs:
# - VerifyDocs # - VerifyDocs
if: success() || failure() if: success() || failure()
with: with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }} python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
coverage_report_json_directory: ${{ fromJson(needs.ConfigParams.outputs.coverage_report_json).directory }} coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
IntermediateCleanUp: IntermediateCleanUp:
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev

View File

@@ -44,24 +44,29 @@ on:
required: false required: false
default: 'doc' default: 'doc'
type: string type: string
coverage_report_json_directory:
description: 'report/coverage'
required: false
type: string
coverage_json_artifact: coverage_json_artifact:
description: 'Name of the coverage JSON artifact.' description: 'Name of the coverage JSON artifact.'
required: false required: false
default: '' default: ''
type: string type: string
coverage_report_json:
description: 'Directory where coverage JSON artifact will be extracted.'
required: false
default: >-
{ "directory": "report/coverage"
}
type: string
unittest_xml_artifact: unittest_xml_artifact:
description: 'Name of the unittest XML artifact.' description: 'Name of the unittest XML artifact.'
required: false required: false
default: '' default: ''
type: string type: string
unittest_xml_directory: unittest_xml:
description: 'Directory where unittest XML artifact will be extracted.' description: 'Directory where unittest XML artifact will be extracted.'
required: false required: false
default: 'report/unit' default: >-
{ "directory": "report/unit"
}
type: string type: string
html_artifact: html_artifact:
description: 'Name of the HTML documentation artifact.' description: 'Name of the HTML documentation artifact.'
@@ -104,7 +109,7 @@ jobs:
if: inputs.unittest_xml_artifact != '' if: inputs.unittest_xml_artifact != ''
with: with:
name: ${{ inputs.unittest_xml_artifact }} name: ${{ inputs.unittest_xml_artifact }}
path: ${{ inputs.unittest_xml_directory }} path: ${{ fromJson(inputs.unittest_xml).directory }}
investigate: true investigate: true
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job - name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
@@ -112,7 +117,7 @@ jobs:
if: inputs.coverage_json_artifact != '' if: inputs.coverage_json_artifact != ''
with: with:
name: ${{ inputs.coverage_json_artifact }} name: ${{ inputs.coverage_json_artifact }}
path: ${{ inputs.coverage_report_json_directory }} path: ${{ fromJson(inputs.coverage_report_json).directory }}
investigate: true investigate: true
- name: ☑ Generate HTML documentation - name: ☑ Generate HTML documentation
@@ -163,7 +168,7 @@ jobs:
if: inputs.unittest_xml_artifact != '' if: inputs.unittest_xml_artifact != ''
with: with:
name: ${{ inputs.unittest_xml_artifact }} name: ${{ inputs.unittest_xml_artifact }}
path: ${{ inputs.unittest_xml_directory }} path: ${{ fromJson(inputs.unittest_xml).directory }}
investigate: true investigate: true
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job - name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
@@ -171,7 +176,7 @@ jobs:
if: inputs.coverage_json_artifact != '' if: inputs.coverage_json_artifact != ''
with: with:
name: ${{ inputs.coverage_json_artifact }} name: ${{ inputs.coverage_json_artifact }}
path: ${{ inputs.coverage_report_json_directory }} path: ${{ fromJson(inputs.coverage_report_json).directory }}
investigate: true investigate: true
- name: ☑ Generate LaTeX documentation - name: ☑ Generate LaTeX documentation

View File

@@ -171,13 +171,13 @@ jobs:
- PublishCoverageResults - PublishCoverageResults
# - VerifyDocs # - VerifyDocs
with: with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }} python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
unittest_xml_directory: ${{ fromJson(needs.ConfigParams.outputs.unittest_report_xml).directory }} unittest_xml: ${{ needs.ConfigParams.outputs.unittest_report_xml }}
coverage_report_json_directory: ${{ fromJson(needs.ConfigParams.outputs.coverage_report_json).directory }} coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
IntermediateCleanUp: IntermediateCleanUp:
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev

View File

@@ -36,10 +36,13 @@ to handover input parameters to the template.
on: on:
push: push:
workflow_dispatch: workflow_dispatch:
schedule:
# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues
- cron: '0 22 * * 5'
jobs: jobs:
<InstanceName>: <InstanceName>:
uses: <GitHubOrganization>/<Repository>/.github/workflows/<Template>.yml@v0 uses: <GitHubOrganization>/<Repository>/.github/workflows/<Template>.yml@r5
with: with:
<Param1>: <Value> <Param1>: <Value>
@@ -57,6 +60,9 @@ Documentation Only (Sphinx)
on: on:
push: push:
workflow_dispatch: workflow_dispatch:
schedule:
# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues
- cron: '0 22 * * 5'
jobs: jobs:
BuildTheDocs: BuildTheDocs:

View File

@@ -44,12 +44,6 @@ Instantiation
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
UnitTestingParams: UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5 uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5

View File

@@ -6,8 +6,8 @@
SphinxDocumentation SphinxDocumentation
################### ###################
The ``SphinxDocumentation`` job template compiles the ReStructured Text documentation using Sphinx to an HTML website The ``SphinxDocumentation`` job template compiles the ReStructured Text documentation using :term:`Sphinx` to an HTML
and a LaTeX documentation. This LaTeX document can be translated using e.g. MikTeX to a PDF file. website and a LaTeX documentation. This LaTeX document can be translated using e.g. :term:`MikTeX` to a PDF file.
.. topic:: Features .. topic:: Features
@@ -70,12 +70,6 @@ Instantiation
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
UnitTestingParams: UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5 uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5
@@ -99,29 +93,29 @@ Parameter Summary
.. rubric:: Goto :ref:`input parameters <JOBTMPL/SphinxDocumentation/Inputs>` .. rubric:: Goto :ref:`input parameters <JOBTMPL/SphinxDocumentation/Inputs>`
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| Parameter Name | Required | Type | Default | | Parameter Name | Required | Type | Default |
+=========================================================================+==========+==========+===================================================================+ +=========================================================================+==========+================+===================================================================+
| :ref:`JOBTMPL/SphinxDocumentation/Input/ubuntu_image_version` | no | string | ``'24.04'`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/ubuntu_image_version` | no | string | ``'24.04'`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/python_version` | no | string | ``'3.13'`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/python_version` | no | string | ``'3.13'`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/requirements` | no | string | ``'-r doc/requirements.txt'`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/requirements` | no | string | ``'-r doc/requirements.txt'`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/doc_directory` | no | string | ``'doc'`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/doc_directory` | no | string | ``'doc'`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/coverage_report_json_directory` | no | string | ``''`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/coverage_json_artifact` | no | string | ``''`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/coverage_json_artifact` | no | string | ``''`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/coverage_report_json` | no | string (JSON) | :jsoncode:`{"directory": "report/coverage"}` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/unittest_xml_artifact` | no | string | ``''`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/unittest_xml_artifact` | no | string | ``''`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/unittest_xml_directory` | no | string | ``'report/unit'`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/unittest_xml` | no | string (JSON) | :jsoncode:`{"directory": "report/unit"}` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/html_artifact` | no | string | ``''`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/html_artifact` | no | string | ``''`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
| :ref:`JOBTMPL/SphinxDocumentation/Input/latex_artifact` | no | string | ``''`` | | :ref:`JOBTMPL/SphinxDocumentation/Input/latex_artifact` | no | string | ``''`` |
+-------------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+ +-------------------------------------------------------------------------+----------+----------------+-------------------------------------------------------------------+
.. rubric:: Goto :ref:`secrets <JOBTMPL/SphinxDocumentation/Secrets>` .. rubric:: Goto :ref:`secrets <JOBTMPL/SphinxDocumentation/Secrets>`
@@ -178,18 +172,6 @@ doc_directory
adjusted as well. adjusted as well.
.. _JOBTMPL/SphinxDocumentation/Input/coverage_report_json_directory:
coverage_report_json_directory
==============================
:Type: string
:Required: no
:Default Value: ``''``
:Possible Values: Any valid directory or sub-directory.
:Description: tbd
.. _JOBTMPL/SphinxDocumentation/Input/coverage_json_artifact: .. _JOBTMPL/SphinxDocumentation/Input/coverage_json_artifact:
coverage_json_artifact coverage_json_artifact
@@ -202,6 +184,40 @@ coverage_json_artifact
:Description: Name of the artifact containing the code coverage report in JSON format. :Description: Name of the artifact containing the code coverage report in JSON format.
.. _JOBTMPL/SphinxDocumentation/Input/coverage_report_json:
coverage_report_json
====================
:Type: string (JSON)
:Required: no
:Default Value:
.. code-block:: json
{ "directory": "reports/coverage",
}
:Possible Values: Any valid JSON string containing a JSON object with fields:
:directory: Directory or sub-directory where the code coverage JSON report will be extracted from
:ref:`artifact <JOBTMPL/SphinxDocumentation/Input/coverage_json_artifact>`.
:Description: Directory as JSON object where the code coverage JSON report will be extracted. |br|
This path is configured in :file:`pyproject.toml` and can be extracted by
:ref:`JOBTMPL/ExtractConfiguration`.
:Example:
.. code-block:: yaml
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
Documentation:
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r5
needs:
- ConfigParams
with:
...
coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
.. _JOBTMPL/SphinxDocumentation/Input/unittest_xml_artifact: .. _JOBTMPL/SphinxDocumentation/Input/unittest_xml_artifact:
unittest_xml_artifact unittest_xml_artifact
@@ -214,16 +230,38 @@ unittest_xml_artifact
:Description: Name of the artifact containing the unittest XML report summary in XML format. :Description: Name of the artifact containing the unittest XML report summary in XML format.
.. _JOBTMPL/SphinxDocumentation/Input/unittest_xml_directory: .. _JOBTMPL/SphinxDocumentation/Input/unittest_xml:
unittest_xml_directory unittest_xml
====================== ============
:Type: string :Type: string (JSON)
:Required: no :Required: no
:Default Value: ``'report/unit'`` :Default Value:
:Possible Values: Any valid directory or sub-directory. .. code-block:: json
:Description: Directory where unittest XML artifact will be extracted.
{ "directory": "reports/unit",
}
:Possible Values: Any valid JSON string containing a JSON object with fields:
:directory: Directory or sub-directory where the unittest JUnit XML report will be extracted from
:ref:`artifact <JOBTMPL/SphinxDocumentation/Input/unittest_xml_artifact>`.
:Description: Directory as JSON object where the unittest JUnit XML report will be extracted. |br|
This path is configured in :file:`pyproject.toml` and can be extracted by
:ref:`JOBTMPL/ExtractConfiguration`.
:Example:
.. code-block:: yaml
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
Documentation:
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r5
needs:
- ConfigParams
with:
...
unittest_xml: ${{ needs.ConfigParams.outputs.unittest_xml }}
.. _JOBTMPL/SphinxDocumentation/Input/html_artifact: .. _JOBTMPL/SphinxDocumentation/Input/html_artifact:

View File

@@ -46,12 +46,6 @@ requires a `name` parameter to create the artifact names.
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
ConfigParams: ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5 uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5

View File

@@ -54,12 +54,6 @@ other reason. Its outputs are used to either run a ``TriggerTaggedRelease`` job
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
Prepare: Prepare:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r5 uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r5

View File

@@ -60,12 +60,6 @@ Simple Example
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
Params: Params:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5 uses: pyTooling/Actions/.github/workflows/Parameters.yml@r5

View File

@@ -71,12 +71,6 @@ pull-request titles.
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs: jobs:
Prepare: Prepare:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r5 uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@r5

View File

@@ -34,6 +34,8 @@ Some templates might provide output parameters, which can be used in dependent j
.. code-block:: yaml .. code-block:: yaml
name: Pipeline
on: on:
push: push:
workflow_dispatch: workflow_dispatch: