ExtractConfiguration

The ExtractConfiguration job template is a …..

Instantiation

The following instantiation example creates a ConfigParams job derived from job template ExtractConfiguration version @r5. It only requires a package_name parameter to extract unit test (pytest) and code coverage (Coverage.py) settings.

name: Pipeline

on:
  push:
  workflow_dispatch:

jobs:
  ConfigParams:
    uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
    with:
      package_name: myPackage

  UnitTesting:
    uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r5
    needs:
      - ConfigParams
    with:
      unittest_report_xml_directory:  ${{ needs.ConfigParams.outputs.unittest_report_xml_directory }}
      unittest_report_xml_filename:   ${{ needs.ConfigParams.outputs.unittest_report_xml_filename }}
      coverage_report_xml_directory:  ${{ needs.ConfigParams.outputs.coverage_report_xml_directory }}
      coverage_report_xml_filename:   ${{ needs.ConfigParams.outputs.coverage_report_xml_filename }}
      coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }}
      coverage_report_json_filename:  ${{ needs.ConfigParams.outputs.coverage_report_json_filename }}
      coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }}

Parameter Summary

Goto input parameters

Parameter Name

Required

Type

Default

ubuntu_image_version

no

string

'24.04'

python_version

no

string

'3.13'

package_namespace

no

string

''

package_name

yes

string

— — — —

coverage_config

no

string

'pyproject.toml'

Goto secrets

This job template needs no secrets.

Goto output parameters

Result Name

Type

Description

package_fullname

string

package_directory

string

mypy_prepare_command

string

unittest_report_xml_directory

string

unittest_report_xml_filename

string

unittest_report_xml

string

unittest_merged_report_xml_directory

string

unittest_merged_report_xml_filename

string

unittest_merged_report_xml

string

coverage_report_html_directory

string

coverage_report_xml_directory

string

coverage_report_xml_filename

string

coverage_report_xml

string

coverage_report_json_directory

string

coverage_report_json_filename

string

coverage_report_json

string

Input Parameters

ubuntu_image_version

Type:

string

Required:

no

Default Value:

'24.04'

Possible Values:

See actions/runner-images - 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, thus, the usual Ubuntu image name like 'ubuntu-24.04' can’t be split into image name and image version.

python_version

Type:

string

Required:

no

Default Value:

'3.13'

Possible Values:

Any valid Python version conforming to the pattern <major>.<minor> or pypy-<major>.<minor>.
See actions/python-versions - available Python versions and actions/setup-python - configurable Python versions.

Description:

Python version used to run Python code in this job.

package_namespace

Type:

string

Required:

no

Default Value:

''

Possible Values:

Any valid Python namespace.

Description:

In case the package is a Python namespace package, the name of the library’s or package’s namespace needs to be specified using this parameter.
In case of a simple Python package, this parameter must be specified as an empty string (''), which is the default.

Example:

Example Instantiation

name: Pipeline

jobs:
  ConfigParams:
    uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
    with:
      package_namespace: myFramework
      package_name:      Extension

Example Directory Structure

📂ProjectRoot/
  📂myFramework/
    📂Extension/
      📦SubPackage/
        🐍__init__.py
        🐍SubModuleA.py
      🐍__init__.py
      🐍ModuleB.py

package_name

Type:

string

Required:

no

Default Value:

''

Possible Values:

Any valid Python package name.

Description:

In case of a simple Python package, this package’s name is specified using this parameter.
In case the package is a Python namespace package, the parameter package_namespace must be specified, too.

Example:

Example Instantiation

name: Pipeline

jobs:
  ConfigParams:
    uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@r5
    with:
      package_name: myPackage

Example Directory Structure

📂ProjectRoot/
  📂myFramework/
    📦SubPackage/
      🐍__init__.py
      🐍SubModuleA.py
    🐍__init__.py
    🐍ModuleB.py

coverage_config

Type:

string

Required:

no

Default Value:

'pyproject.toml'

Possible Values:

Any valid path to a pyproject.toml file.
Alternatively, path to a .coveragerc file (deprecated).

Description:

Path to a Python project configuration file for extraction of project settings.

Example:

Extracted values from pyproject.toml

[tool.pytest]
junit_xml = "report/unit/UnittestReportSummary.xml"

[tool.pyedaa-reports]
junit_xml = "report/unit/unittest.xml"

[tool.coverage.xml]
output = "report/coverage/coverage.xml"

[tool.coverage.json]
output = "report/coverage/coverage.json"

[tool.coverage.html]
directory = "report/coverage/html"
title="Code Coverage of pyDummy"

Secrets

This job template needs no secrets.

Outputs

package_fullname

Type:

string

Description:

Returns the full package name composed from package_namespace and package_name.

Example:

myFramework.Extension

package_directory

Type:

string

Description:

Returns the full package path composed from package_namespace and package_name.

Example:

myFramework/Extension

mypy_prepare_command

Type:

string

Description:

Returns a preparation command for mypy.
In case the Python package is a namespace package, an __init__.py must be created, otherwise mypy has problems analyzing the namespace package.

Example:

touch myFramework/__init__.py

unittest_report_xml_directory

Type:

string

Description:

Returns the directory where the unittest XML report file (pytest JUnit XML) will be created.
This is the directory portion of unittest_report_xml.

Example:

reports/unit

pyproject.toml:
[tool.pytest]
junit_xml = "report/unit/UnittestReportSummary.xml"

unittest_report_xml_filename

Type:

string

Description:

Returns the filename of the unittest XML report file (pytest JUnit XML).
This is the filename portion of unittest_report_xml.

Example:

UnittestReportSummary.xml

pyproject.toml:
[tool.pytest]
junit_xml = "report/unit/UnittestReportSummary.xml"

unittest_report_xml

Type:

string

Description:

Returns the path where the unittest XML report file (pytest JUnit XML) will be created.
This is the concatenation of directory portion and filename portion.

Example:

reports/unit/UnittestReportSummary.xml

pyproject.toml:
[tool.pytest]
junit_xml = "report/unit/UnittestReportSummary.xml"

unittest_merged_report_xml_directory

Type:

string

Description:

Returns the directory where the merged unittest XML report file (pyedaa-reports JUnit XML) will be created.
This is the directory portion of unittest_merged_report_xml.

Example:

reports/unit

pyproject.toml:
[tool.pyedaa-reports]
junit_xml = "report/unit/unittest.xml"

unittest_merged_report_xml_filename

Type:

string

Description:

Returns the filename of the merged unittest XML report (pyedaa-reports JUnit XML).
This is the filename portion of unittest_merged_report_xml.

Example:

unittest.xml

pyproject.toml:
[tool.pyedaa-reports]
junit_xml = "report/unit/unittest.xml"

unittest_merged_report_xml

Type:

string

Description:

Returns the path where the merged unittest XML report file (pyedaa-reports JUnit XML) will be created.
This is the concatenation of directory portion and filename portion.

Example:

report/unit/unittest.xml

pyproject.toml:
[tool.pyedaa-reports]
junit_xml = "report/unit/unittest.xml"

coverage_report_html_directory

Type:

string

Description:

Returns the directory where the code coverage HTML report (Coverage.py) will be generated.

Example:

report/coverage/html

pyproject.toml:
[tool.coverage.html]
directory = "report/coverage/html"
title="Code Coverage of pyDummy"

coverage_report_xml_directory

Type:

string

Description:

Returns the directory where the code coverage XML report file (Coverage.py) will be created.
This is the directory portion of coverage_report_xml.

Example:

reports/coverage

pyproject.toml:
[tool.coverage.xml]
output = "report/coverage/coverage.xml"

coverage_report_xml_filename

Type:

string

Description:

Returns the filename of the code coverage XML report file (Coverage.py).
This is the filename portion of coverage_report_xml.

Example:

coverage.xml

pyproject.toml:
[tool.coverage.xml]
output = "report/coverage/coverage.xml"

coverage_report_xml

Type:

string

Description:

Returns the path where the code coverage XML report file (Coverage.py) will be created.
This is the concatenation of directory portion and filename portion.

Example:

report/coverage/coverage.xml

pyproject.toml:
[tool.coverage.xml]
output = "report/coverage/coverage.xml"

coverage_report_json_directory

Type:

string

Description:

Returns the directory where the code coverage JSON report file (Coverage.py) will be created.
This is the directory portion of coverage_report_json.

Example:

reports/coverage

pyproject.toml:
[tool.coverage.json]
output = "report/coverage/coverage.json"

coverage_report_json_filename

Type:

string

Description:

Returns the filename of the code coverage JSON report file (Coverage.py).
This is the filename portion of coverage_report_json.

Example:

coverage.json

pyproject.toml:
[tool.coverage.json]
output = "report/coverage/coverage.json"

coverage_report_json

Type:

string

Description:

Returns the path where the code coverage JSON report file (Coverage.py) will be created.
This is the concatenation of directory portion and filename portion.

Example:

report/coverage/coverage.json

pyproject.toml:
[tool.coverage.json]
output = "report/coverage/coverage.json"

Optimizations

This template offers no optimizations (reduced job runtime).