mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
391 lines
17 KiB
YAML
391 lines
17 KiB
YAML
# ==================================================================================================================== #
|
|
# Authors: #
|
|
# Patrick Lehmann #
|
|
# #
|
|
# ==================================================================================================================== #
|
|
# Copyright 2020-2025 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: Namespace Package
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
package_namespace:
|
|
description: 'Name of the tool''s namespace.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
package_name:
|
|
description: 'Name of the tool''s package.'
|
|
required: true
|
|
type: string
|
|
unittest_python_version:
|
|
description: 'Python version.'
|
|
required: false
|
|
default: '3.13'
|
|
type: string
|
|
unittest_python_version_list:
|
|
description: 'Space separated list of Python versions to run tests with.'
|
|
required: false
|
|
default: '3.9 3.10 3.11 3.12 3.13'
|
|
type: string
|
|
unittest_system_list:
|
|
description: 'Space separated list of systems to run tests on.'
|
|
required: false
|
|
default: 'ubuntu windows macos macos-arm mingw64 ucrt64'
|
|
type: string
|
|
unittest_include_list:
|
|
description: 'Space separated list of system:python items to be included into the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
unittest_exclude_list:
|
|
description: 'Space separated list of system:python items to be excluded from the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
unittest_disable_list:
|
|
description: 'Space separated list of system:python items to be disabled from the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
apptest_python_version:
|
|
description: 'Python version.'
|
|
required: false
|
|
default: '3.13'
|
|
type: string
|
|
apptest_python_version_list:
|
|
description: 'Space separated list of Python versions to run tests with.'
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
apptest_system_list:
|
|
description: 'Space separated list of systems to run tests on.'
|
|
required: false
|
|
default: 'ubuntu windows macos macos-arm ucrt64'
|
|
type: string
|
|
apptest_include_list:
|
|
description: 'Space separated list of system:python items to be included into the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
apptest_exclude_list:
|
|
description: 'Space separated list of system:python items to be excluded from the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
apptest_disable_list:
|
|
description: 'Space separated list of system:python items to be disabled from the list of test.'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
codecov:
|
|
description: 'Publish merged coverage and unittest reports to Codecov.'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
codacy:
|
|
description: 'Publish merged coverage report to Codacy.'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
dorny:
|
|
description: 'Publish merged unittest report via Dorny Test-Reporter.'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
cleanup:
|
|
description: 'Cleanup artifacts afterwards.'
|
|
required: false
|
|
default: true
|
|
type: boolean
|
|
secrets:
|
|
PYPI_TOKEN:
|
|
description: "Token for pushing releases to PyPI."
|
|
required: false
|
|
CODECOV_TOKEN:
|
|
description: "Token for pushing coverage and unittest results to Codecov."
|
|
required: false
|
|
CODACY_PROJECT_TOKEN:
|
|
description: "Token for pushing coverage results to Codacy."
|
|
required: false
|
|
|
|
jobs:
|
|
Prepare:
|
|
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
|
|
|
|
ConfigParams:
|
|
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
|
|
with:
|
|
package_namespace: ${{ inputs.package_namespace }}
|
|
package_name: ${{ inputs.package_name }}
|
|
|
|
UnitTestingParams:
|
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
|
|
with:
|
|
package_namespace: ${{ inputs.package_namespace }}
|
|
package_name: ${{ inputs.package_name }}
|
|
python_version: ${{ inputs.unittest_python_version }}
|
|
python_version_list: ${{ inputs.unittest_python_version_list }}
|
|
system_list: ${{ inputs.unittest_system_list }}
|
|
include_list: ${{ inputs.unittest_include_list }}
|
|
exclude_list: ${{ inputs.unittest_exclude_list }}
|
|
disable_list: ${{ inputs.unittest_disable_list }}
|
|
|
|
# AppTestingParams:
|
|
# uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
|
|
# with:
|
|
# package_namespace: ${{ inputs.package_namespace }}
|
|
# package_name: ${{ inputs.package_name }}
|
|
# python_version: ${{ inputs.apptest_python_version }}
|
|
# python_version_list: ${{ inputs.apptest_python_version_list }}
|
|
# system_list: ${{ inputs.apptest_system_list }}
|
|
# include_list: ${{ inputs.apptest_include_list }}
|
|
# exclude_list: ${{ inputs.apptest_exclude_list }}
|
|
# disable_list: ${{ inputs.apptest_disable_list }}
|
|
|
|
UnitTesting:
|
|
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
with:
|
|
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
|
|
requirements: "-r tests/unit/requirements.txt"
|
|
# pacboy: "msys/git python-lxml:p"
|
|
unittest_report_xml_directory: ${{ needs.ConfigParams.outputs.unittest_report_xml_directory }}
|
|
unittest_report_xml_filename: ${{ needs.ConfigParams.outputs.unittest_report_xml_filename }}
|
|
coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }}
|
|
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
|
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
|
|
StaticTypeCheck:
|
|
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
with:
|
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
commands: |
|
|
${{ needs.ConfigParams.outputs.mypy_prepare_command }}
|
|
mypy --html-report report/typing -p ${{ needs.ConfigParams.outputs.package_fullname }}
|
|
html_report: 'report/typing'
|
|
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
|
|
|
|
DocCoverage:
|
|
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
with:
|
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
directory: ${{ needs.ConfigParams.outputs.package_directory }}
|
|
# fail_below: 70
|
|
|
|
Package:
|
|
uses: pyTooling/Actions/.github/workflows/Package.yml@dev
|
|
needs:
|
|
- UnitTestingParams
|
|
- UnitTesting
|
|
with:
|
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
|
|
# AppTesting:
|
|
# uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@dev
|
|
# needs:
|
|
# - AppTestingParams
|
|
# - UnitTestingParams
|
|
# - Package
|
|
# with:
|
|
# jobs: ${{ needs.AppTestingParams.outputs.python_jobs }}
|
|
# wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
# apptest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}
|
|
|
|
PublishCoverageResults:
|
|
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
- UnitTesting
|
|
with:
|
|
# coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
|
# coverage_report_xml_directory: ${{ needs.ConfigParams.outputs.coverage_report_xml_directory }}
|
|
# coverage_report_xml_filename: ${{ needs.ConfigParams.outputs.coverage_report_xml_filename }}
|
|
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
|
coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }}
|
|
coverage_report_json_filename: ${{ needs.ConfigParams.outputs.coverage_report_json_filename }}
|
|
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
coverage_report_html_directory: ${{ needs.ConfigParams.outputs.coverage_report_html_directory }}
|
|
codecov: ${{ inputs.codecov }}
|
|
codacy: ${{ inputs.codacy }}
|
|
secrets: inherit
|
|
|
|
PublishTestResults:
|
|
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
- UnitTesting
|
|
with:
|
|
testsuite-summary-name: ${{ inputs.package_name }}
|
|
merged_junit_filename: ${{ needs.ConfigParams.outputs.unittest_merged_report_xml_filename }}
|
|
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
|
dorny: ${{ inputs.dorny }}
|
|
codecov: ${{ inputs.codecov }}
|
|
secrets: inherit
|
|
|
|
# VerifyDocs:
|
|
# 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@dev
|
|
needs:
|
|
- ConfigParams
|
|
- UnitTestingParams
|
|
- 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 }}
|
|
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
|
|
|
|
IntermediateCleanUp:
|
|
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev
|
|
needs:
|
|
- UnitTestingParams
|
|
- PublishCoverageResults
|
|
- PublishTestResults
|
|
- Documentation
|
|
if: ${{ inputs.cleanup }}
|
|
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@dev
|
|
# needs:
|
|
# - UnitTestingParams
|
|
# - Documentation
|
|
# with:
|
|
# document: pyEDAA.ProjectModel
|
|
# latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
|
|
# pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
|
|
|
|
PublishToGitHubPages:
|
|
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev
|
|
needs:
|
|
- UnitTestingParams
|
|
- Documentation
|
|
# - PDFDocumentation
|
|
- PublishCoverageResults
|
|
- StaticTypeCheck
|
|
with:
|
|
doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
|
|
coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
|
|
|
|
TriggerTaggedRelease:
|
|
uses: pyTooling/Actions/.github/workflows/TagReleaseCommit.yml@dev
|
|
needs:
|
|
- Prepare
|
|
- UnitTesting
|
|
# - AppTesting
|
|
# - StaticTypeCheck
|
|
- Package
|
|
- PublishToGitHubPages
|
|
if: needs.Prepare.outputs.is_release_commit
|
|
permissions:
|
|
contents: write # required for create tag
|
|
actions: write # required for trigger workflow
|
|
with:
|
|
version: ${{ needs.Prepare.outputs.version }}
|
|
auto_tag: ${{ needs.Prepare.outputs.is_release_commit }}
|
|
secrets: inherit
|
|
|
|
ReleasePage:
|
|
uses: pyTooling/Actions/.github/workflows/PublishReleaseNotes.yml@dev
|
|
needs:
|
|
- Prepare
|
|
- UnitTesting
|
|
# - AppTesting
|
|
# - StaticTypeCheck
|
|
- Package
|
|
- PublishToGitHubPages
|
|
if: needs.Prepare.outputs.is_release_tag == 'true'
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
with:
|
|
tag: ${{ needs.Prepare.outputs.version }}
|
|
secrets: inherit
|
|
|
|
PublishOnPyPI:
|
|
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev
|
|
needs:
|
|
- Prepare
|
|
- UnitTestingParams
|
|
- ReleasePage
|
|
if: needs.Prepare.outputs.is_release_tag == 'true'
|
|
with:
|
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
requirements: -r dist/requirements.txt
|
|
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
secrets: inherit
|
|
|
|
ArtifactCleanUp:
|
|
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev
|
|
needs:
|
|
- UnitTestingParams
|
|
- UnitTesting
|
|
- StaticTypeCheck
|
|
- Documentation
|
|
# - PDFDocumentation
|
|
- PublishTestResults
|
|
- PublishCoverageResults
|
|
- PublishToGitHubPages
|
|
# - PublishOnPyPI
|
|
- IntermediateCleanUp
|
|
if: ${{ inputs.cleanup }}
|
|
with:
|
|
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
remaining: |
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-*
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-*
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-*
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-*
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
|
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
|
|
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}-*
|
|
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
|