From b9b9b0b1d450e7499862fe409152552cd0b69ddf Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 08:41:51 +0100 Subject: [PATCH 1/6] Added ubuntu_image_version parameter. --- .github/workflows/ArtifactCleanUp.yml | 7 ++++++- .github/workflows/CheckDocumentation.yml | 7 ++++++- .github/workflows/CoverageCollection.yml | 7 ++++++- .github/workflows/IntermediateCleanUp.yml | 7 ++++++- .github/workflows/LaTeXDocumentation.yml | 7 ++++++- .github/workflows/Package.yml | 7 ++++++- .github/workflows/Parameters.yml | 7 ++++++- .github/workflows/PublishCoverageResults.yml | 7 ++++++- .github/workflows/PublishOnPyPI.yml | 7 ++++++- .github/workflows/PublishTestResults.yml | 7 ++++++- .github/workflows/PublishToGitHubPages.yml | 7 ++++++- .github/workflows/Release.yml | 2 +- .github/workflows/StaticTypeCheck.yml | 7 ++++++- .github/workflows/VerifyDocs.yml | 7 ++++++- pyproject.toml | 2 +- tests/requirements.txt | 2 +- 16 files changed, 81 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ArtifactCleanUp.yml b/.github/workflows/ArtifactCleanUp.yml index 97929fb..02c72e7 100644 --- a/.github/workflows/ArtifactCleanUp.yml +++ b/.github/workflows/ArtifactCleanUp.yml @@ -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 @@ -38,7 +43,7 @@ on: jobs: ArtifactCleanUp: name: 🗑️ Artifact Cleanup - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🗑️ Delete package Artifacts diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index e88a6bd..71187fe 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -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 @@ -42,7 +47,7 @@ on: jobs: DocCoverage: name: 👀 Check documentation coverage - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 4f8b019..0352027 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -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 @@ -63,7 +68,7 @@ jobs: Coverage: name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index d1a6607..0499174 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -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 @@ -36,7 +41,7 @@ on: jobs: IntermediateCleanUp: name: 🗑️ Intermediate Artifact Cleanup - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🗑️ Delete SQLite coverage artifacts from matrix jobs uses: geekyeggo/delete-artifact@v5 diff --git a/.github/workflows/LaTeXDocumentation.yml b/.github/workflows/LaTeXDocumentation.yml index 675ae04..54ca4f0 100644 --- a/.github/workflows/LaTeXDocumentation.yml +++ b/.github/workflows/LaTeXDocumentation.yml @@ -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 @@ -42,7 +47,7 @@ on: jobs: PDFDocumentation: name: 📓 Converting LaTeX Documentation to PDF - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job uses: actions/download-artifact@v4 diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index b18ad87..476bd37 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -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 @@ -44,7 +49,7 @@ jobs: Package: name: 📦 Package in Source and Wheel Format - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 7983420..393ee55 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -25,6 +25,11 @@ name: Parameters on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string name: description: 'Name of the tool.' required: true @@ -96,7 +101,7 @@ on: jobs: Parameters: - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" outputs: python_version: ${{ steps.params.outputs.python_version }} python_jobs: ${{ steps.params.outputs.python_jobs }} diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 395a120..2e55096 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -24,6 +24,11 @@ name: Publish Code Coverage Results on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string coverage_config: description: 'Path to the .coveragerc file. Use pyproject.toml by default.' required: false @@ -57,7 +62,7 @@ on: jobs: PublishCoverageResults: name: 📊 Publish Code Coverage Results - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" if: always() steps: diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index f108670..b951463 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -25,6 +25,11 @@ name: Publish on PyPI 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 @@ -48,7 +53,7 @@ jobs: PublishOnPyPI: name: 🚀 Publish to PyPI - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index 4ff32f8..a4e5cd5 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -25,6 +25,11 @@ name: Publish Unit Test Results on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string merged_junit_artifact: description: 'Name of the merged JUnit Test Summary artifact.' required: false @@ -44,7 +49,7 @@ on: jobs: PublishTestResults: name: 📊 Publish Test Results - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" if: always() steps: diff --git a/.github/workflows/PublishToGitHubPages.yml b/.github/workflows/PublishToGitHubPages.yml index 325512b..9f6ed1b 100644 --- a/.github/workflows/PublishToGitHubPages.yml +++ b/.github/workflows/PublishToGitHubPages.yml @@ -25,6 +25,11 @@ name: Publish to GitHub Pages on: workflow_call: inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string doc: description: 'Name of the documentation artifact.' required: true @@ -44,7 +49,7 @@ jobs: PublishToGitHubPages: name: 📚 Publish to GH-Pages - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 764eee7..db77a13 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -29,7 +29,7 @@ jobs: Release: name: 📝 Create 'Release Page' on GitHub - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: 🔁 Extract Git tag from GITHUB_REF diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index c37d64f..82fe2bf 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -25,6 +25,11 @@ name: Static Type Check 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 @@ -63,7 +68,7 @@ jobs: StaticTypeCheck: name: 👀 Check Static Typing using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index 574f9c5..f816305 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -25,6 +25,11 @@ name: Verify examples 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 @@ -35,7 +40,7 @@ jobs: VerifyDocs: name: 👍 Verify example snippets using Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + runs-on: "ubuntu-${ubuntu_image_version}" steps: - name: ⏬ Checkout repository diff --git a/pyproject.toml b/pyproject.toml index 210f2d9..4ad4951 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 75.2", + "setuptools ~= 75.3", "wheel ~= 0.44", "pyTooling ~= 7.0" ] diff --git a/tests/requirements.txt b/tests/requirements.txt index 130f5c6..2ad659b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,7 +5,7 @@ Coverage ~= 7.6 # Test Runner pytest ~= 8.3 -pytest-cov ~= 5.0 +pytest-cov ~= 6.0 # Static Type Checking mypy ~= 1.13 From c924651632013a959752807bc17b74059613b552 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 08:42:32 +0100 Subject: [PATCH 2/6] Split Sphinx into a prepare and two working sub-jobs for HTML and LaTeX. --- .github/workflows/SphinxDocumentation.yml | 102 ++++++++++++++++++---- .github/workflows/_Checking_Pipeline.yml | 32 +++---- 2 files changed, 101 insertions(+), 33 deletions(-) diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 6fe793b..3d74408 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -24,6 +24,11 @@ name: 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 @@ -71,17 +76,20 @@ on: type: string jobs: - Sphinx: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: ubuntu-24.04 + Prepare: + name: 📓 Extract configurations from pyproject.toml + runs-on: "ubuntu-${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: 🔧 Install graphviz - run: sudo apt-get install -y --no-install-recommends graphviz - - name: 🐍 Setup Python ${{ inputs.python_version }} uses: actions/setup-python@v5 with: @@ -154,6 +162,29 @@ jobs: print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}") + Sphinx-HTML: + name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + runs-on: "ubuntu-${ubuntu_image_version}" + needs: + - Prepare + + steps: + - name: ⏬ Checkout repository + uses: actions/checkout@v4 + + - name: 🔧 Install graphviz + run: sudo apt-get install -y --no-install-recommends graphviz + + - 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 + python -m pip install --disable-pip-version-check ${{ inputs.requirements }} + - name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job if: inputs.unittest_xml_artifact != '' uses: actions/download-artifact@v4 @@ -166,7 +197,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ steps.getVariables.outputs.coverage_report_json_directory }} + path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} - name: ☑ Generate HTML documentation if: inputs.html_artifact != '' @@ -176,16 +207,6 @@ jobs: cd "${{ inputs.doc_directory || '.' }}" sphinx-build -v -n -b html -d _build/doctrees -j $(nproc) -w _build/html.log . _build/html - - name: ☑ Generate LaTeX documentation - if: inputs.latex_artifact != '' -# continue-on-error: true - run: | - export PYTHONPATH=$(pwd) - - cd "${{ inputs.doc_directory || '.' }}" - sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex -# --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html - - name: 📤 Upload 'HTML Documentation' artifact if: inputs.html_artifact != '' continue-on-error: true @@ -196,6 +217,53 @@ jobs: if-no-files-found: error retention-days: 1 + Sphinx-LaTeX: + name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + runs-on: "ubuntu-${ubuntu_image_version}" + needs: + - Prepare + + steps: + - name: ⏬ Checkout repository + uses: actions/checkout@v4 + + - name: 🔧 Install graphviz + run: sudo apt-get install -y --no-install-recommends graphviz + + - 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 + python -m pip install --disable-pip-version-check ${{ inputs.requirements }} + + - name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job + if: inputs.unittest_xml_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.unittest_xml_artifact }} + path: ${{ inputs.unittest_xml_directory }} + + - name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job + if: inputs.coverage_json_artifact != '' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.coverage_json_artifact }} + path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + + - name: ☑ Generate LaTeX documentation + if: inputs.latex_artifact != '' +# continue-on-error: true + run: | + export PYTHONPATH=$(pwd) + + cd "${{ inputs.doc_directory || '.' }}" + sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex +# --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html + - name: 📤 Upload 'LaTeX Documentation' artifact if: inputs.latex_artifact != '' continue-on-error: true diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index dba6805..d418fe9 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: pyDummy python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev + uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@sphinx # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@sphinx needs: - UnitTestingParams with: @@ -69,7 +69,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx needs: - UnitTestingParams - UnitTesting @@ -84,7 +84,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@sphinx needs: - UnitTesting - PlatformTesting @@ -92,7 +92,7 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@dev + uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx needs: - UnitTestingParams - UnitTesting @@ -103,14 +103,14 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} HTMLDocumentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams # - VerifyDocs @@ -122,7 +122,7 @@ jobs: latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} PDFDocumentation: - uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r1 + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx needs: - UnitTestingParams - HTMLDocumentation @@ -132,7 +132,7 @@ jobs: pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx needs: - UnitTestingParams - HTMLDocumentation @@ -146,7 +146,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@dev + uses: pyTooling/Actions/.github/workflows/Release.yml@sphinx if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -157,7 +157,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@sphinx if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -171,7 +171,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@sphinx needs: - UnitTestingParams - PlatformTestingParams From bec076bd665fb0d87ccf02ed4860453d6a9ac5c2 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 09:07:27 +0100 Subject: [PATCH 3/6] Fixed pipeline syntax. --- .github/workflows/ArtifactCleanUp.yml | 2 +- .github/workflows/CheckDocumentation.yml | 2 +- .github/workflows/CoverageCollection.yml | 2 +- .github/workflows/IntermediateCleanUp.yml | 2 +- .github/workflows/LaTeXDocumentation.yml | 2 +- .github/workflows/Package.yml | 2 +- .github/workflows/Parameters.yml | 2 +- .github/workflows/PublishCoverageResults.yml | 2 +- .github/workflows/PublishOnPyPI.yml | 2 +- .github/workflows/PublishTestResults.yml | 2 +- .github/workflows/PublishToGitHubPages.yml | 2 +- .github/workflows/Release.yml | 2 +- .github/workflows/SphinxDocumentation.yml | 6 +++--- .github/workflows/StaticTypeCheck.yml | 2 +- .github/workflows/VerifyDocs.yml | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ArtifactCleanUp.yml b/.github/workflows/ArtifactCleanUp.yml index 02c72e7..23f0a9e 100644 --- a/.github/workflows/ArtifactCleanUp.yml +++ b/.github/workflows/ArtifactCleanUp.yml @@ -43,7 +43,7 @@ on: jobs: ArtifactCleanUp: name: 🗑️ Artifact Cleanup - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🗑️ Delete package Artifacts diff --git a/.github/workflows/CheckDocumentation.yml b/.github/workflows/CheckDocumentation.yml index 71187fe..3a9fa1f 100644 --- a/.github/workflows/CheckDocumentation.yml +++ b/.github/workflows/CheckDocumentation.yml @@ -47,7 +47,7 @@ on: jobs: DocCoverage: name: 👀 Check documentation coverage - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 0352027..3106933 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -68,7 +68,7 @@ jobs: Coverage: name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/IntermediateCleanUp.yml b/.github/workflows/IntermediateCleanUp.yml index 0499174..1ba9295 100644 --- a/.github/workflows/IntermediateCleanUp.yml +++ b/.github/workflows/IntermediateCleanUp.yml @@ -41,7 +41,7 @@ on: jobs: IntermediateCleanUp: name: 🗑️ Intermediate Artifact Cleanup - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🗑️ Delete SQLite coverage artifacts from matrix jobs uses: geekyeggo/delete-artifact@v5 diff --git a/.github/workflows/LaTeXDocumentation.yml b/.github/workflows/LaTeXDocumentation.yml index 54ca4f0..a12bc0a 100644 --- a/.github/workflows/LaTeXDocumentation.yml +++ b/.github/workflows/LaTeXDocumentation.yml @@ -47,7 +47,7 @@ on: jobs: PDFDocumentation: name: 📓 Converting LaTeX Documentation to PDF - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job uses: actions/download-artifact@v4 diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index 476bd37..9a60d1a 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -49,7 +49,7 @@ jobs: Package: name: 📦 Package in Source and Wheel Format - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 393ee55..55bdc1b 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -101,7 +101,7 @@ on: jobs: Parameters: - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" outputs: python_version: ${{ steps.params.outputs.python_version }} python_jobs: ${{ steps.params.outputs.python_jobs }} diff --git a/.github/workflows/PublishCoverageResults.yml b/.github/workflows/PublishCoverageResults.yml index 2e55096..5365e46 100644 --- a/.github/workflows/PublishCoverageResults.yml +++ b/.github/workflows/PublishCoverageResults.yml @@ -62,7 +62,7 @@ on: jobs: PublishCoverageResults: name: 📊 Publish Code Coverage Results - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" if: always() steps: diff --git a/.github/workflows/PublishOnPyPI.yml b/.github/workflows/PublishOnPyPI.yml index b951463..637fe00 100644 --- a/.github/workflows/PublishOnPyPI.yml +++ b/.github/workflows/PublishOnPyPI.yml @@ -53,7 +53,7 @@ jobs: PublishOnPyPI: name: 🚀 Publish to PyPI - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job diff --git a/.github/workflows/PublishTestResults.yml b/.github/workflows/PublishTestResults.yml index a4e5cd5..e7447d9 100644 --- a/.github/workflows/PublishTestResults.yml +++ b/.github/workflows/PublishTestResults.yml @@ -49,7 +49,7 @@ on: jobs: PublishTestResults: name: 📊 Publish Test Results - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" if: always() steps: diff --git a/.github/workflows/PublishToGitHubPages.yml b/.github/workflows/PublishToGitHubPages.yml index 9f6ed1b..6fbf320 100644 --- a/.github/workflows/PublishToGitHubPages.yml +++ b/.github/workflows/PublishToGitHubPages.yml @@ -49,7 +49,7 @@ jobs: PublishToGitHubPages: name: 📚 Publish to GH-Pages - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index db77a13..bb9c686 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -29,7 +29,7 @@ jobs: Release: name: 📝 Create 'Release Page' on GitHub - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: 🔁 Extract Git tag from GITHUB_REF diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 3d74408..16bb16b 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -78,7 +78,7 @@ on: jobs: Prepare: name: 📓 Extract configurations from pyproject.toml - runs-on: "ubuntu-${ubuntu_image_version}" + 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 }} @@ -164,7 +164,7 @@ jobs: Sphinx-HTML: name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" needs: - Prepare @@ -219,7 +219,7 @@ jobs: Sphinx-LaTeX: name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" needs: - Prepare diff --git a/.github/workflows/StaticTypeCheck.yml b/.github/workflows/StaticTypeCheck.yml index 82fe2bf..feb8c69 100644 --- a/.github/workflows/StaticTypeCheck.yml +++ b/.github/workflows/StaticTypeCheck.yml @@ -68,7 +68,7 @@ jobs: StaticTypeCheck: name: 👀 Check Static Typing using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository diff --git a/.github/workflows/VerifyDocs.yml b/.github/workflows/VerifyDocs.yml index f816305..9f4ec22 100644 --- a/.github/workflows/VerifyDocs.yml +++ b/.github/workflows/VerifyDocs.yml @@ -40,7 +40,7 @@ jobs: VerifyDocs: name: 👍 Verify example snippets using Python ${{ inputs.python_version }} - runs-on: "ubuntu-${ubuntu_image_version}" + runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" steps: - name: ⏬ Checkout repository From ef5c852097d81292d545aaf8660dd1f63d9c1eee Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 09:20:22 +0100 Subject: [PATCH 4/6] Fixed pipeline dependencies. --- .github/workflows/_Checking_Pipeline.yml | 62 ++++++++++++++++-------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index d418fe9..02ee025 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -9,7 +9,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx with: name: pyDummy - python_version_list: "3.8 3.9 3.10 3.11 3.12 3.13 pypy-3.8 pypy-3.9 pypy-3.10" + python_version_list: "3.9 3.10 3.11 3.12 3.13 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: @@ -68,6 +68,26 @@ jobs: html_report: 'htmlmypy' html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} + DocCoverage: + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r1 + needs: + - UnitTestingParams + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + directory: sphinx_reports +# fail_below: 70 + + Package: + uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx + needs: + - UnitTestingParams + - UnitTesting +# - Coverage + - PlatformTesting + with: + python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} + PublishCoverageResults: uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx needs: @@ -91,17 +111,6 @@ jobs: with: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' - Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx - needs: - - UnitTestingParams - - UnitTesting -# - Coverage - - PlatformTesting - with: - python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} - # VerifyDocs: # uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx # needs: @@ -109,10 +118,12 @@ jobs: # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - HTMLDocumentation: + Documentation: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams + - PublishTestResults + - PublishCoverageResults # - VerifyDocs with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} @@ -121,11 +132,22 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} + IntermediateCleanUp: + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r1 + needs: + - UnitTestingParams + - PublishCoverageResults + - PublishTestResults + - Documentation + with: + sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- + xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- + PDFDocumentation: uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx needs: - UnitTestingParams - - HTMLDocumentation + - Documentation with: document: actions latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} @@ -135,7 +157,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx needs: - UnitTestingParams - - HTMLDocumentation + - Documentation # - PDFDocumentation # - Coverage - PublishCoverageResults @@ -176,13 +198,15 @@ jobs: - UnitTestingParams - PlatformTestingParams - UnitTesting - - PlatformTesting # - Coverage - StaticTypeCheck -# - BuildTheDocs - - PublishToGitHubPages - - PublishCoverageResults + - PlatformTesting + - Documentation +# - PDFDocumentation - PublishTestResults + - PublishCoverageResults + - PublishToGitHubPages + - IntermediateCleanUp with: package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} remaining: | From 77a6b4c00af6e7145370770cf031267cd128b5e9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 10:56:43 +0100 Subject: [PATCH 5/6] Use new extract job. --- .github/workflows/BuildTheDocs.yml | 3 + .github/workflows/CoverageCollection.yml | 3 + .github/workflows/ExtractConfiguration.yml | 144 +++++++++++++++++++++ .github/workflows/Parameters.yml | 1 + .github/workflows/SphinxDocumentation.yml | 107 ++------------- .github/workflows/_Checking_Pipeline.yml | 7 + 6 files changed, 166 insertions(+), 99 deletions(-) create mode 100644 .github/workflows/ExtractConfiguration.yml diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index a8d72c1..a1f9baf 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -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 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 3106933..cf7e635 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -71,6 +71,9 @@ jobs: 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 diff --git a/.github/workflows/ExtractConfiguration.yml b/.github/workflows/ExtractConfiguration.yml new file mode 100644 index 0000000..5ce99bc --- /dev/null +++ b/.github/workflows/ExtractConfiguration.yml @@ -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}") diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 55bdc1b..c6d03fc 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -101,6 +101,7 @@ on: jobs: Parameters: + name: ✎ Generate pipeline parameters runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" outputs: python_version: ${{ steps.params.outputs.python_version }} diff --git a/.github/workflows/SphinxDocumentation.yml b/.github/workflows/SphinxDocumentation.yml index 16bb16b..ed10ac2 100644 --- a/.github/workflows/SphinxDocumentation.yml +++ b/.github/workflows/SphinxDocumentation.yml @@ -39,16 +39,15 @@ on: required: false default: '-r doc/requirements.txt' type: string - coverage_config: - description: 'Path to the .coveragerc file. Use pyproject.toml by default.' - required: false - default: 'pyproject.toml' - type: string doc_directory: description: 'Path to the directory containing documentation (Sphinx working directory).' required: false default: 'doc' type: string + coverage_report_json_directory: + description: '' + required: true + type: string coverage_json_artifact: description: 'Name of the coverage JSON artifact.' required: false @@ -76,97 +75,9 @@ on: type: string jobs: - Prepare: - 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 - python -m pip install --disable-pip-version-check ${{ inputs.requirements }} - - - 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}") - Sphinx-HTML: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + name: 📓 HTML Documentation using Sphinx and Python ${{ inputs.python_version }} runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" - needs: - - Prepare steps: - name: ⏬ Checkout repository @@ -197,7 +108,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + path: ${{ inputs.coverage_report_json_directory }} - name: ☑ Generate HTML documentation if: inputs.html_artifact != '' @@ -218,10 +129,8 @@ jobs: retention-days: 1 Sphinx-LaTeX: - name: 📓 Documentation generation using Sphinx and Python ${{ inputs.python_version }} + name: 📓 LaTeX Documentation using Sphinx and Python ${{ inputs.python_version }} runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" - needs: - - Prepare steps: - name: ⏬ Checkout repository @@ -252,7 +161,7 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ inputs.coverage_json_artifact }} - path: ${{ needs.Prepare.outputs.coverage_report_json_directory }} + path: ${{ inputs.coverage_report_json_directory }} - name: ☑ Generate LaTeX documentation if: inputs.latex_artifact != '' diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index 02ee025..f6f40b0 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -77,6 +77,11 @@ jobs: directory: sphinx_reports # fail_below: 70 + ConfigParams: + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@sphinx + needs: + - DocCoverage + Package: uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx needs: @@ -122,11 +127,13 @@ jobs: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx needs: - UnitTestingParams + - ConfigParams - PublishTestResults - PublishCoverageResults # - VerifyDocs with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }} # unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} # coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} From f737b0799206aa3a9bc1f463862b9f124922de41 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 13:52:23 +0100 Subject: [PATCH 6/6] Prepare for merge. [skip ci] --- .github/workflows/BuildTheDocs.yml | 2 +- .github/workflows/CoverageCollection.yml | 2 +- .github/workflows/Release.yml | 7 ++++- .github/workflows/_Checking_Pipeline.yml | 34 ++++++++++++------------ 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/BuildTheDocs.yml b/.github/workflows/BuildTheDocs.yml index a1f9baf..44152e1 100644 --- a/.github/workflows/BuildTheDocs.yml +++ b/.github/workflows/BuildTheDocs.yml @@ -38,7 +38,7 @@ jobs: 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'. " + 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 diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index cf7e635..f7dab10 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -72,7 +72,7 @@ jobs: 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'. " + 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 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index bb9c686..96f7c67 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -24,9 +24,14 @@ name: Release on: workflow_call: + inputs: + ubuntu_image_version: + description: 'Ubuntu image version.' + required: false + default: '24.04' + type: string jobs: - Release: name: 📝 Create 'Release Page' on GitHub runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}" diff --git a/.github/workflows/_Checking_Pipeline.yml b/.github/workflows/_Checking_Pipeline.yml index f6f40b0..e652bef 100644 --- a/.github/workflows/_Checking_Pipeline.yml +++ b/.github/workflows/_Checking_Pipeline.yml @@ -6,21 +6,21 @@ on: jobs: UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyDummy python_version_list: "3.9 3.10 3.11 3.12 3.13 pypy-3.9 pypy-3.10" # disable_list: "windows:pypy-3.10" PlatformTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: Platform python_version_list: "" system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64" UnitTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - UnitTestingParams with: @@ -33,7 +33,7 @@ jobs: # coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }} PlatformTesting: - uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@sphinx + uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev needs: - PlatformTestingParams with: @@ -48,7 +48,7 @@ jobs: coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }} # Coverage: -# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@sphinx +# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@dev # needs: # - UnitTestingParams # with: @@ -58,7 +58,7 @@ jobs: # codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@sphinx + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev needs: - UnitTestingParams with: @@ -78,12 +78,12 @@ jobs: # fail_below: 70 ConfigParams: - uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@sphinx + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev needs: - DocCoverage Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Package.yml@dev needs: - UnitTestingParams - UnitTesting @@ -94,7 +94,7 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: - UnitTestingParams - UnitTesting @@ -109,7 +109,7 @@ jobs: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} PublishTestResults: - uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev needs: - UnitTesting - PlatformTesting @@ -117,14 +117,14 @@ jobs: additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"' # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@sphinx +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} Documentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@sphinx + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev needs: - UnitTestingParams - ConfigParams @@ -151,7 +151,7 @@ jobs: xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- PDFDocumentation: - uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@sphinx + uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev needs: - UnitTestingParams - Documentation @@ -161,7 +161,7 @@ jobs: pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev needs: - UnitTestingParams - Documentation @@ -175,7 +175,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@sphinx + uses: pyTooling/Actions/.github/workflows/Release.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTesting @@ -186,7 +186,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@sphinx + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -200,7 +200,7 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@sphinx + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - UnitTestingParams - PlatformTestingParams