Added Sphinx based documentation.

(cherry picked from commit f9f5dd5117a14ba31a3a9113a1de2c12c624dffb)
This commit is contained in:
Patrick Lehmann
2022-10-29 22:40:27 +02:00
parent 88175d0d21
commit c78c1c8503
34 changed files with 1524 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
ArtifactCleanUp
###############
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,39 @@
BuildTheDocs
############
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,45 @@
CoverageCollection
##################
collect code coverage data (incl. branch coverage)
with `pytest`/`pytest-cov`/`coverage.py` using a single version of Python (latest). It generates HTML and Cobertura
(XML)reports, upload the HTML report as an artifact, and upload the test results to Codecov and Codacy. Configuration
options to `pytest` and `coverage.py` should be given via section `[tool.pytest.ini_options]` and `[tool.coverage.*]`
in a `pyproject.toml` file.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,41 @@
Package
#######
generate source and wheel packages, and upload them as an artifact.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,139 @@
Parameters
##########
The `Parameters` job template is a workaround for the limitations of GitHub Actions to handle global variables in
GitHub Actions workflows (see [actions/runner#480](https://github.com/actions/runner/issues/480)).
It generates output parameters with artifact names and a job matrix to be used in later running jobs.
Instantiation
*************
Simple Example
==============
The following instantiation example creates a job `Params` derived from job template `Parameters` version `r0`. It only
requires a `name` parameter to create the artifact names.
.. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs:
Params:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0
with:
name: pyTooling
Complex Example
===============
The following instantiation example creates 3 jobs from the same template, but with differing input parameters. The
first job `UnitTestingParams` might be used to create a job matrix of unit tests. It creates the cross of default
systems (Windows, Ubuntu, MacOS, MinGW64) and the given list of Python versions including some mypy versions. In
addition a list of excludes (marked as :deletetion:`deletion`) and includes (marked as :additions:`additions`) is handed
over resulting in the following combinations:
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| Version | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12.a1 | mypy-3.7 | mypy-3.8 | mypy-3.9 |
+=========+=============+=============+=============+==============+=========================+=========+==========+==============================+==============================+
| Windows | windows:3.7 | windows:3.8 | windows:3.9 | windows:3.10 | | | | :deletion:`windows:mypy-3.8` | :deletion:`windows:mypy-3.9` |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| Ubuntu | ubuntu:3.7 | ubuntu:3.8 | ubuntu:3.9 | ubuntu:3.10 | :addition:`ubuntu:3.11` | | | ubuntu:mypy-3.8 | ubuntu:mypy-3.9 |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| MacOS | macos:3.7 | macos:3.8 | macos:3.9 | macos:3.10 | :addition:`macos:3.11` | | | macos:mypy-3.8 | macos:mypy-3.9 |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| MSYS | | | | | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| MinGW32 | | | | | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| MinGW64 | | | | mingw64:3.10 | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| Clang32 | | | | | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| Clang64 | | | | | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
| UCRT64 | | | | | | | | | |
+---------+-------------+-------------+-------------+--------------+-------------------------+---------+----------+------------------------------+------------------------------+
.. code-block:: yaml
name: Pipeline
on:
push:
workflow_dispatch:
jobs:
UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0
with:
name: pyTooling
python_version_list: "3.7 3.8 3.9 3.10 pypy-3.8 pypy-3.9"
include_list: "ubuntu:3.11 macos:3.11"
exclude_list: "windows:pypy-3.8 windows:pypy-3.9"
PerformanceTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0
with:
name: pyTooling
python_version_list: "3.10 3.11"
system_list: "ubuntu windows macos"
PlatformTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
name: pyTooling
python_version_list: "3.10"
system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64"
Template Parameters
*******************
Name
======
The name of the library or package.
It's used to create artifact names.
python_version_list
===================
TBD
system_list
===========
TBD
include_list
============
TBD
exclude_list
============
TBD
Template Results
****************
Params
======
Jobs
====

View File

@@ -0,0 +1,86 @@
PublishOnPyPI
#############
Publish a source (``*.tar.gz``) and wheel (``*.whl``) packages to `PyPI <https://pypi.org/>`__.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
jobs:
# ...
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r0
if: startsWith(github.ref, 'refs/tags')
with:
artifact: Package
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Complex Example
===============
.. code-block:: yaml
jobs:
# ...
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r0
if: startsWith(github.ref, 'refs/tags')
needs:
- Params
- Package
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.Package }}
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Template Parameters
*******************
python_version
==============
Python version used for uploading the package contents via `twine` to PyPI.
**Default:** 3.11
requirements
============
List of requirements to be installed for uploading the package contents to PyPI.
**Default:** wheel, twine
artifact
========
Name of the artifact containing the package(s).
Secrets
*******
PYPI_TOKEN
==========
The token to access the package at PyPI for uploading new data.
Template Results
****************
*None*
Dependencies
************
* actions/download-artifact
* actions/setup-python
* geekyeggo/delete-artifact

View File

@@ -0,0 +1,39 @@
PublishTestResults
##################
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,39 @@
PublishToGitHubPages
####################
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,41 @@
Release
#######
publish GitHub Release.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,65 @@
StaticTypeCheck
###############
collect static type check result with `mypy`, and
optionally upload results as an HTML report.
Example `commands`:
1. Regular package
```yml
commands: mypy --html-report htmlmypy -p ToolName
```
2. Parent namespace package
```yml
commands: |
touch Parent/__init__.py
mypy --html-report htmlmypy -p ToolName
```
3. Child namespace package
```yml
commands: |
cd Parent
mypy --html-report ../htmlmypy -p ToolName
```
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,43 @@
UnitTesting
###########
run unit test with `pytest` using multiple versions of Python, and
optionally upload results as XML reports. Configuration options to `pytest` should be given via section
`[tool.pytest.ini_options]` in a `pyproject.toml` file.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,41 @@
VerifyDocs
##########
extract code examples from the README and test these code snippets.
Instantiation
*************
Simple Example
==============
.. code-block:: yaml
TBD
Complex Example
===============
.. code-block:: yaml
TBD
Template Parameters
*******************
TBD 1
=====
TBD
TBD 1
=====
TBD
Template Results
****************
*None*

View File

@@ -0,0 +1,4 @@
Overview
########