Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Nov 10, 2024
2 parents 1c42072 + e7e95b4 commit 99f30da
Show file tree
Hide file tree
Showing 38 changed files with 1,285 additions and 287 deletions.
9 changes: 0 additions & 9 deletions .btd.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/ArtifactCleanUp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ name: ArtifactCleanUp
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
package:
description: 'Artifacts to be removed on not tagged runs.'
required: true
Expand All @@ -38,7 +43,7 @@ on:
jobs:
ArtifactCleanUp:
name: 🗑️ Artifact Cleanup
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"

steps:
- name: 🗑️ Delete package Artifacts
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/BuildTheDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: '❗ Deprecation message'
run: echo "::warning title=Deprecated::'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'."

- name: ⏬ Checkout repository
uses: actions/checkout@v4

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/CheckDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ name: Check Documentation
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
python_version:
description: 'Python version.'
required: false
Expand All @@ -42,7 +47,7 @@ on:
jobs:
DocCoverage:
name: 👀 Check documentation coverage
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/CoverageCollection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ name: Coverage Collection
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
python_version:
description: 'Python version.'
required: false
Expand Down Expand Up @@ -63,9 +68,12 @@ jobs:

Coverage:
name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }}
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"

steps:
- name: '❗ Deprecation message'
run: echo "::warning title=Deprecated::'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'."

- name: ⏬ Checkout repository
uses: actions/checkout@v4

Expand Down
144 changes: 144 additions & 0 deletions .github/workflows/ExtractConfiguration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# ==================================================================================================================== #
# Authors: #
# Patrick Lehmann #
# #
# ==================================================================================================================== #
# Copyright 2020-2024 The pyTooling Authors #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# #
# SPDX-License-Identifier: Apache-2.0 #
# ==================================================================================================================== #
name: Extract Configuration

on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
python_version:
description: 'Python version.'
required: false
default: '3.12'
type: string
coverage_config:
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
required: false
default: 'pyproject.toml'
type: string

outputs:
coverage_report_html_directory:
description: ""
value: ${{ jobs.Extract.outputs.coverage_report_html_directory }}
coverage_report_xml_directory:
description: ""
value: ${{ jobs.Extract.outputs.coverage_report_xml_directory }}
coverage_report_xml:
description: ""
value: ${{ jobs.Extract.outputs.coverage_report_xml }}
coverage_report_json_directory:
description: ""
value: ${{ jobs.Extract.outputs.coverage_report_json_directory }}
coverage_report_json:
description: ""
value: ${{ jobs.Extract.outputs.coverage_report_json }}

jobs:
Extract:
name: 📓 Extract configurations from pyproject.toml
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
outputs:
coverage_report_html_directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
coverage_report_xml_directory: ${{ steps.getVariables.outputs.coverage_report_xml_directory }}
coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }}
coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }}
coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }}

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4

- name: 🐍 Setup Python ${{ inputs.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: 🔧 Install wheel,tomli and pip dependencies (native)
run: |
python -m pip install --disable-pip-version-check -U wheel tomli
- name: 🔁 Extract configurations from pyproject.toml
id: getVariables
shell: python
run: |
from os import getenv
from pathlib import Path
from sys import version
from textwrap import dedent
print(f"Python: {version}")
from tomli import load as tomli_load
htmlDirectory = Path("htmlcov")
xmlFile = Path("./coverage.xml")
jsonFile = Path("./coverage.json")
coverageRC = "${{ inputs.coverage_config }}".strip()
# Read output paths from 'pyproject.toml' file
if coverageRC == "pyproject.toml":
pyProjectFile = Path("pyproject.toml")
if pyProjectFile.exists():
with pyProjectFile.open("rb") as file:
pyProjectSettings = tomli_load(file)
htmlDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"])
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
else:
print(f"File '{pyProjectFile}' not found.")
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
exit(1)
# Read output paths from '.coveragerc' file
elif len(coverageRC) > 0:
coverageRCFile = Path(coverageRC)
if coverageRCFile.exists():
with coverageRCFile.open("rb") as file:
coverageRCSettings = tomli_load(file)
htmlDirectory = Path(coverageRCSettings["html"]["directory"])
xmlFile = Path(coverageRCSettings["xml"]["output"])
jsonFile = Path(coverageRCSettings["json"]["output"])
else:
print(f"File '{coverageRCFile}' not found.")
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
exit(1)
# Write jobs to special file
github_output = Path(getenv("GITHUB_OUTPUT"))
print(f"GITHUB_OUTPUT: {github_output}")
with github_output.open("a+", encoding="utf-8") as f:
f.write(dedent(f"""\
coverage_report_html_directory={htmlDirectory.as_posix()}
coverage_report_xml_directory={xmlFile.parent.as_posix()}
coverage_report_xml={xmlFile.as_posix()}
coverage_report_json_directory={jsonFile.parent.as_posix()}
coverage_report_json={jsonFile.as_posix()}
"""))
print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}")
9 changes: 7 additions & 2 deletions .github/workflows/IntermediateCleanUp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ name: Intermediate Cleanup
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
sqlite_coverage_artifacts_prefix:
description: 'Prefix for SQLite coverage artifacts'
required: false
Expand All @@ -36,7 +41,7 @@ on:
jobs:
IntermediateCleanUp:
name: 🗑️ Intermediate Artifact Cleanup
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
steps:
- name: 🗑️ Delete SQLite coverage artifacts from matrix jobs
uses: geekyeggo/delete-artifact@v5
Expand All @@ -45,7 +50,7 @@ jobs:
with:
name: ${{ inputs.sqlite_coverage_artifacts_prefix }}*

- name: 🗑️ Delete XML coverage artifacts from matrix jobs
- name: 🗑️ Delete JUnit XML artifacts from matrix jobs
uses: geekyeggo/delete-artifact@v5
if: inputs.xml_unittest_artifacts_prefix != ''
continue-on-error: true
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/LaTeXDocumentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ name: LaTeX Documentation
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
document:
description: 'LaTeX root document without *.tex extension.'
required: true
Expand All @@ -42,7 +47,7 @@ on:
jobs:
PDFDocumentation:
name: 📓 Converting LaTeX Documentation to PDF
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
steps:
- name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job
uses: actions/download-artifact@v4
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ name: Package
on:
workflow_call:
inputs:
ubuntu_image_version:
description: 'Ubuntu image version.'
required: false
default: '24.04'
type: string
python_version:
description: 'Python version.'
required: false
Expand All @@ -44,7 +49,7 @@ jobs:

Package:
name: 📦 Package in Source and Wheel Format
runs-on: ubuntu-24.04
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"

steps:
- name: ⏬ Checkout repository
Expand Down
Loading

0 comments on commit 99f30da

Please sign in to comment.