Renamed artifacts.

This commit is contained in:
Patrick Lehmann
2022-11-05 15:11:14 +01:00
parent 7ef3bc0a4a
commit 96bccfbd18
5 changed files with 277 additions and 111 deletions

View File

@@ -1,32 +1,97 @@
.. _JOBTMPL:
Overview
########
**Global Templates**
The following list categorizes all pre-defined job templates, which can be instantiated in a pipeline (GitHub Action
Workflow). They can also serve as an example for creating or driving own job templates.
* :ref:`JOBTMPL/Parameters`
**Table of Contents:**
**Unit Tests, Code Coverage, ...**
.. hlist::
:columns: 2
* :ref:`JOBTMPL/UnitTesting`
* :ref:`JOBTMPL/CodeCoverage`
* :ref:`JOBTMPL/StaticTypeChecking`
* **Global Templates**
**Build and Packaging**
* :ref:`JOBTMPL/Parameters`
* :ref:`JOBTMPL/Package`
* **Unit Tests, Code Coverage, Code Quality, ...**
**Documentation**
* :ref:`JOBTMPL/UnitTesting`
* :ref:`JOBTMPL/CodeCoverage`
* :ref:`JOBTMPL/StaticTypeChecking`
* *code formatting (planned)*
* *coding style (planned)*
* *code linting (planned)*
* :ref:`JOBTMPL/VerifyDocumentation`
* :ref:`JOBTMPL/BuildTheDocs`
* **Build and Packaging**
**Publishing**
* :ref:`JOBTMPL/Package`
* :ref:`JOBTMPL/GitHubReleasePage`
* :ref:`JOBTMPL/PyPI`
* :ref:`JOBTMPL/PublishTestResults`
* :ref:`JOBTMPL/PublishToGitHubPages`
* **Documentation**
**Cleanups**
* :ref:`JOBTMPL/VerifyDocumentation`
* :ref:`JOBTMPL/BuildTheDocs`
* :ref:`JOBTMPL/ArtifactCleanup`
* **Releasing, Publishing**
* :ref:`JOBTMPL/GitHubReleasePage`
* :ref:`JOBTMPL/PyPI`
* :ref:`JOBTMPL/PublishTestResults`
* :ref:`JOBTMPL/PublishToGitHubPages`
* **Cleanups**
* :ref:`JOBTMPL/ArtifactCleanup`
Instantiation
*************
The job templates (GitHub Action *Reusable Workflows*) need to be stored in the same directory where normal pipelines
(GitHub Action *Workflows*) are located: ``.github/workflows/<template>.yml``. These template files are distinguished
from a normal pipeline by a ``on:workflow_call:`` section compared to an ``on:push`` section.
**Job Template Definition:**
The ``workflow_call`` allows the definition of input and output parameters.
.. code-block:: yaml
on:
workflow_call:
inputs:
<Param1>:
# ...
outputs:
# ...
jobs:
<JobName>:
# ...
**Job Template Instantiation:**
When instantiating a template, a ``jobs:<Name>:uses`` is used to refer to a template file. Unfortunately, besides the
GitHub SLUG (*<Organization>/<Repository>*), also the full path to the template needs to be gives, but still it can't be
outside of ``.github/workflows`` to create a cleaner repository structure. Finally, the path contains a branch name
postfixed by ``@<branch>`` (tags are still not supported by GitHub Actions). A ``jobs:<Name>:with:`` section can be used
to handover input parameters to the template.
.. code-block:: yaml
on:
push:
workflow_dispatch:
jobs:
<InstanceName>:
uses: <GitHubOrganization>/<Repository>/.github/workflows/<Template>.yml@v0
with:
<Param1>: <Value>
Development
***********
.. todo:: JobTemplate:Development Needs documentation

View File

@@ -0,0 +1,50 @@
Repository Structure
####################
pyTooling Actions assumes a certain repository structure and usage of technologies. Besides assumed directory or file
names in default parameters to job templates, almost all can be overwritten if the target repository has a differing
structure.
* Python source code is located in a directory named after the Python package name.
* All tests are located in a ``/tests`` directory and separated by testing approach.
* E.g. unit tests are located in a ``/tests/unit`` directory.
* The package documentation is located in a ``/doc`` directory.
* Documentation is written with ReStructured Text (ReST) and translated using Sphinx.
* Documentation requirements are listed in a ``/doc/requirements.txt``.
* Dependencies are listed in a ``/requirements.txt``.
* If the build process requires separate dependencies, a ``/build/requirements.txt`` is used.
* If the publishing/distribution process requires separate dependencies, a ``/dist/requirements.txt`` is used.
* All Python project settings are stored in a ``pyproject.toml``.
* The Python package is described in a ``setup.py``.
* A repository overview is given in a ``README.md``.
.. code-block::
<Repository>/
.github/
workflows/
Pipeline.yml
dependabot.yml
.vscode/
settings.json
build/
requirements.txt
dist/
requirements.txt
doc/
conf.py
index.rst
requirements.txt
<package>
__init__.py
tests/
unit/
requirements.txt
.editorconfig
.gitignore
LICENSE.md
pyproject.toml
README.md
requirements.txt
setup.py

View File

@@ -38,35 +38,44 @@ This repository gathers reusable CI tooling for testing, packaging and distribut
GitHub Action Job Templates
***************************
**Global Templates**
The following list categorizes all pre-defined job templates, which can be instantiated in a pipeline (GitHub Action
Workflow):
* :ref:`JOBTMPL/Parameters`
.. hlist::
:columns: 2
**Unit Tests, Code Coverage, ...**
* **Global Templates**
* :ref:`JOBTMPL/UnitTesting`
* :ref:`JOBTMPL/CodeCoverage`
* :ref:`JOBTMPL/StaticTypeChecking`
* :ref:`JOBTMPL/Parameters`
**Build and Packaging**
* **Unit Tests, Code Coverage, Code Quality, ...**
* :ref:`JOBTMPL/Package`
* :ref:`JOBTMPL/UnitTesting`
* :ref:`JOBTMPL/CodeCoverage`
* :ref:`JOBTMPL/StaticTypeChecking`
* *code formatting (planned)*
* *coding style (planned)*
* *code linting (planned)*
**Documentation**
* **Build and Packaging**
* :ref:`JOBTMPL/VerifyDocumentation`
* :ref:`JOBTMPL/BuildTheDocs`
* :ref:`JOBTMPL/Package`
**Publishing**
* **Documentation**
* :ref:`JOBTMPL/GitHubReleasePage`
* :ref:`JOBTMPL/PyPI`
* :ref:`JOBTMPL/PublishTestResults`
* :ref:`JOBTMPL/PublishToGitHubPages`
* :ref:`JOBTMPL/VerifyDocumentation`
* :ref:`JOBTMPL/BuildTheDocs`
**Cleanups**
* **Releasing, Publishing**
* :ref:`JOBTMPL/ArtifactCleanup`
* :ref:`JOBTMPL/GitHubReleasePage`
* :ref:`JOBTMPL/PyPI`
* :ref:`JOBTMPL/PublishTestResults`
* :ref:`JOBTMPL/PublishToGitHubPages`
* **Cleanups**
* :ref:`JOBTMPL/ArtifactCleanup`
Example Pipelines
@@ -132,6 +141,7 @@ License
:hidden:
Background
RepositoryStructure
Releases
Dependency