mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
v6.4.0
This commit is contained in:
9
.github/workflows/ApplicationTesting.yml
vendored
9
.github/workflows/ApplicationTesting.yml
vendored
@@ -220,11 +220,16 @@ jobs:
|
|||||||
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
|
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 🔧 Install wheel from artifact
|
- name: 🔧 Install wheel from artifact (Ubuntu/macOS)
|
||||||
|
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
|
||||||
run: |
|
run: |
|
||||||
ls -l install
|
|
||||||
python -m pip install --disable-pip-version-check -U install/*.whl
|
python -m pip install --disable-pip-version-check -U install/*.whl
|
||||||
|
|
||||||
|
- name: 🔧 Install wheel from artifact (Windows)
|
||||||
|
if: ( matrix.system == 'windows' || matrix.system == 'windows-arm' )
|
||||||
|
run: |
|
||||||
|
python -m pip install -v --disable-pip-version-check (Get-Item .\install\*.whl).FullName
|
||||||
|
|
||||||
- name: ✅ Run application tests (Ubuntu/macOS)
|
- name: ✅ Run application tests (Ubuntu/macOS)
|
||||||
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
|
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
13
.github/workflows/CompletePipeline.yml
vendored
13
.github/workflows/CompletePipeline.yml
vendored
@@ -93,6 +93,16 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
|
default: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
|
||||||
type: string
|
type: string
|
||||||
|
bandit:
|
||||||
|
description: 'Run Static Application Security Testing (SAST) using Bandit.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
pylint:
|
||||||
|
description: 'Run Python linting using pylint.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
codecov:
|
codecov:
|
||||||
description: 'Publish merged coverage and unittest reports to Codecov.'
|
description: 'Publish merged coverage and unittest reports to Codecov.'
|
||||||
required: false
|
required: false
|
||||||
@@ -205,6 +215,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
|
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
|
||||||
|
bandit: ${{ inputs.bandit }}
|
||||||
|
pylint: ${{ inputs.pylint }}
|
||||||
artifact: CodeQuality
|
artifact: CodeQuality
|
||||||
|
|
||||||
DocCoverage:
|
DocCoverage:
|
||||||
@@ -219,7 +231,6 @@ jobs:
|
|||||||
uses: pyTooling/Actions/.github/workflows/Package.yml@main
|
uses: pyTooling/Actions/.github/workflows/Package.yml@main
|
||||||
needs:
|
needs:
|
||||||
- UnitTestingParams
|
- UnitTestingParams
|
||||||
# - UnitTesting
|
|
||||||
with:
|
with:
|
||||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
||||||
|
|||||||
38
.github/workflows/ExtractConfiguration.yml
vendored
38
.github/workflows/ExtractConfiguration.yml
vendored
@@ -114,7 +114,7 @@ jobs:
|
|||||||
coverageRC = "${{ inputs.coverage_config }}".strip()
|
coverageRC = "${{ inputs.coverage_config }}".strip()
|
||||||
typingCoberturaFile = Path("report/typing/cobertura.xml")
|
typingCoberturaFile = Path("report/typing/cobertura.xml")
|
||||||
typingJUnitFile = Path("report/typing/StaticTypingSummary.xml")
|
typingJUnitFile = Path("report/typing/StaticTypingSummary.xml")
|
||||||
typingHTMLDirectory = Path("htmlmypy")
|
typingHTMLDirectory = Path("report/typing/html")
|
||||||
|
|
||||||
# Read output paths from 'pyproject.toml' file
|
# Read output paths from 'pyproject.toml' file
|
||||||
if coverageRC == "pyproject.toml":
|
if coverageRC == "pyproject.toml":
|
||||||
@@ -123,14 +123,34 @@ jobs:
|
|||||||
with pyProjectFile.open("rb") as file:
|
with pyProjectFile.open("rb") as file:
|
||||||
pyProjectSettings = tomli_load(file)
|
pyProjectSettings = tomli_load(file)
|
||||||
|
|
||||||
unittestXMLFile = Path(pyProjectSettings["tool"]["pytest"]["junit_xml"])
|
toolSection = pyProjectSettings["tool"]
|
||||||
mergedUnittestXMLFile = Path(pyProjectSettings["tool"]["pyedaa-reports"]["junit_xml"])
|
if "pytest" in toolSection:
|
||||||
coverageHTMLDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"])
|
section = toolSection["pytest"]
|
||||||
coverageXMLFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
if "junit_xml" in section:
|
||||||
coverageJSONFile= Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
unittestXMLFile = Path(section["junit_xml"])
|
||||||
typingCoberturaFile = Path(pyProjectSettings["tool"]["mypy"]["cobertura_xml_report"]) / "cobertura.xml"
|
|
||||||
typingJUnitFile = Path(pyProjectSettings["tool"]["mypy"]["junit_xml"])
|
if "pyedaa-reports" in toolSection:
|
||||||
typingHTMLDirectory = Path(pyProjectSettings["tool"]["mypy"]["html_report"])
|
section = toolSection["pyedaa-reports"]
|
||||||
|
if "junit_xml" in section:
|
||||||
|
mergedUnittestXMLFile = Path(section["junit_xml"])
|
||||||
|
|
||||||
|
if "coverage" in toolSection:
|
||||||
|
section = toolSection["coverage"]
|
||||||
|
if "html" in section:
|
||||||
|
coverageHTMLDirectory = Path(section["html"]["directory"])
|
||||||
|
if "xml" in section:
|
||||||
|
coverageXMLFile = Path(section["xml"]["output"])
|
||||||
|
if "json" in section:
|
||||||
|
coverageJSONFile= Path(section["json"]["output"])
|
||||||
|
|
||||||
|
if "mypy" in toolSection:
|
||||||
|
section = toolSection["mypy"]
|
||||||
|
if "cobertura_xml_report" in section:
|
||||||
|
typingCoberturaFile = Path(section["cobertura_xml_report"]) / "cobertura.xml"
|
||||||
|
if "junit_xml" in section:
|
||||||
|
typingJUnitFile = Path(section["junit_xml"])
|
||||||
|
if "html_report" in section:
|
||||||
|
typingHTMLDirectory = Path(section["html_report"])
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
|||||||
2
.github/workflows/Parameters.yml
vendored
2
.github/workflows/Parameters.yml
vendored
@@ -164,7 +164,7 @@ jobs:
|
|||||||
package_name = "${{ inputs.package_name }}".strip()
|
package_name = "${{ inputs.package_name }}".strip()
|
||||||
name = "${{ inputs.name }}".strip()
|
name = "${{ inputs.name }}".strip()
|
||||||
|
|
||||||
if package_namespace == "": # or package_namespace == ".":
|
if package_namespace == "":
|
||||||
package_fullname = package_name
|
package_fullname = package_name
|
||||||
package_directory = package_name
|
package_directory = package_name
|
||||||
elif package_namespace[-2:] == ".*":
|
elif package_namespace[-2:] == ".*":
|
||||||
|
|||||||
59
.github/workflows/PrepareJob.yml
vendored
59
.github/workflows/PrepareJob.yml
vendored
@@ -191,13 +191,14 @@ jobs:
|
|||||||
printf "${ANSI_LIGHT_GREEN} [OK]\n"
|
printf "${ANSI_LIGHT_GREEN} [OK]\n"
|
||||||
|
|
||||||
default_branch="${defaultBranch}"
|
default_branch="${defaultBranch}"
|
||||||
printf " default_branch=%s\n" "${default_branch}"
|
printf " Default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${default_branch}"
|
||||||
else
|
else
|
||||||
printf "${ANSI_LIGHT_RED} [FAILED]\n"
|
printf "${ANSI_LIGHT_RED} [FAILED]\n"
|
||||||
printf " %s\n" "${default_branch}"
|
printf " ${ANSI_LIGHT_RED}%s${ANSI_NOCOLOR}\n" "${default_branch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Commit checks:\n"
|
printf "Commit checks:\n"
|
||||||
|
printf " Commit: %s\n" "${{ github.sha }}"
|
||||||
printf " Commit kind "
|
printf " Commit kind "
|
||||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||||
is_regular_commit="true"
|
is_regular_commit="true"
|
||||||
@@ -208,24 +209,37 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Branch checks:\n"
|
printf "Branch checks:\n"
|
||||||
|
printf " Branch: %s\n" "${branch}"
|
||||||
|
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${defaultBranch}"
|
||||||
if [[ "${branch}" == "${defaultBranch}" ]]; then
|
if [[ "${branch}" == "${defaultBranch}" ]]; then
|
||||||
on_default_branch="true"
|
on_default_branch="true"
|
||||||
printf " Commit on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
|
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.main_branch }}"
|
||||||
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
|
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
|
||||||
on_main_branch="true"
|
on_main_branch="true"
|
||||||
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
|
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.release_branch }}"
|
||||||
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
||||||
on_release_branch="true"
|
on_release_branch="true"
|
||||||
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
|
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.development_branch }}"
|
||||||
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
||||||
on_dev_branch="true"
|
on_dev_branch="true"
|
||||||
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
|
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${is_merge_commit}" == "true" ]]; then
|
if [[ "${is_merge_commit}" == "true" ]]; then
|
||||||
@@ -261,11 +275,14 @@ jobs:
|
|||||||
|
|
||||||
NIGHTLY_TAG_PATTERN='^${{ inputs.nightly_tag_pattern }}$'
|
NIGHTLY_TAG_PATTERN='^${{ inputs.nightly_tag_pattern }}$'
|
||||||
RELEASE_TAG_PATTERN='^${{ inputs.release_tag_pattern }}$'
|
RELEASE_TAG_PATTERN='^${{ inputs.release_tag_pattern }}$'
|
||||||
printf " Check tag name against regexp '%s' ... " "${RELEASE_TAG_PATTERN}"
|
|
||||||
if [[ "${tag}" =~ NIGHTLY_TAG_PATTERN ]]; then
|
printf "Tag checks:\n"
|
||||||
|
printf " Tag: %s\n" "${tag}"
|
||||||
|
printf " Check tag '%s' against regexp ... " "${tag}"
|
||||||
|
if [[ "${tag}" =~ ${NIGHTLY_TAG_PATTERN} ]]; then
|
||||||
printf "${ANSI_LIGHT_GREEN}[NIGHTLY]${ANSI_NOCOLOR}\n"
|
printf "${ANSI_LIGHT_GREEN}[NIGHTLY]${ANSI_NOCOLOR}\n"
|
||||||
is_nightly_tag="true"
|
is_nightly_tag="true"
|
||||||
elif [[ "${tag}" =~ $RELEASE_TAG_PATTERN ]]; then
|
elif [[ "${tag}" =~ ${RELEASE_TAG_PATTERN} ]]; then
|
||||||
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
||||||
version="${tag}"
|
version="${tag}"
|
||||||
is_release_tag="true"
|
is_release_tag="true"
|
||||||
@@ -277,6 +294,30 @@ jobs:
|
|||||||
printf "::error title=RexExpCheck::Tag name '%s' doesn't conform to regexp '%s' nor '%s'.\n" "${tag}" "${NIGHTLY_TAG_PATTERN}" "${RELEASE_TAG_PATTERN}"
|
printf "::error title=RexExpCheck::Tag name '%s' doesn't conform to regexp '%s' nor '%s'.\n" "${tag}" "${NIGHTLY_TAG_PATTERN}" "${RELEASE_TAG_PATTERN}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${is_nightly_tag}" == "true" ]]; then
|
||||||
|
printf " Check if nightly tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
|
||||||
|
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
|
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif [[ "${is_release_tag}" == "true" ]]; then
|
||||||
|
printf " Check if release tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
|
||||||
|
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
|
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
|
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
|
||||||
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
|
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
|
||||||
ref_kind="pullrequest"
|
ref_kind="pullrequest"
|
||||||
|
|||||||
2
dist/requirements.txt
vendored
2
dist/requirements.txt
vendored
@@ -1,2 +1,2 @@
|
|||||||
wheel ~= 0.45
|
wheel ~= 0.45
|
||||||
twine ~= 6.1
|
twine ~= 6.2
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ Example Pipelines
|
|||||||
.. code-block:: toml
|
.. code-block:: toml
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.5"]
|
requires = ["setuptools >= 80.0", "wheel ~= 0.45", "pyTooling ~= 8.7"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-r ../requirements.txt
|
-r ../requirements.txt
|
||||||
|
|
||||||
pyTooling ~= 8.5
|
pyTooling ~= 8.7
|
||||||
|
|
||||||
# Enforce latest version on ReadTheDocs
|
# Enforce latest version on ReadTheDocs
|
||||||
sphinx ~= 8.2
|
sphinx ~= 8.2
|
||||||
@@ -13,7 +13,7 @@ sphinx_rtd_theme ~= 3.0
|
|||||||
# Sphinx Extenstions
|
# Sphinx Extenstions
|
||||||
sphinxcontrib-mermaid ~= 1.0
|
sphinxcontrib-mermaid ~= 1.0
|
||||||
autoapi >= 2.0.1
|
autoapi >= 2.0.1
|
||||||
sphinx_design ~= 0.6.1
|
sphinx_design ~= 0.6
|
||||||
sphinx-copybutton >= 0.5.2
|
sphinx-copybutton >= 0.5
|
||||||
sphinx_autodoc_typehints ~= 3.2
|
sphinx_autodoc_typehints ~= 3.2
|
||||||
sphinx_reports ~= 0.9
|
sphinx_reports ~= 0.9
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ __version__ = "0.4.5"
|
|||||||
__keywords__ = ["GitHub Actions"]
|
__keywords__ = ["GitHub Actions"]
|
||||||
__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues"
|
__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues"
|
||||||
|
|
||||||
|
from pickle import dumps
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
|
|
||||||
from pyTooling.Decorators import export, readonly
|
from pyTooling.Decorators import export, readonly
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
requires = [
|
requires = [
|
||||||
"setuptools >= 80.0",
|
"setuptools >= 80.0",
|
||||||
"wheel ~= 0.45",
|
"wheel ~= 0.45",
|
||||||
"pyTooling ~= 8.5"
|
"pyTooling ~= 8.7"
|
||||||
]
|
]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.pylint.format]
|
[tool.pylint.format]
|
||||||
indent-string="\t"
|
indent-string="\t"
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
|
ignore-long-lines = "^.{0,110}#: .*"
|
||||||
|
|
||||||
[tool.pylint.basic]
|
[tool.pylint.basic]
|
||||||
argument-naming-style = "camelCase"
|
argument-naming-style = "camelCase"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
pyTooling ~= 8.5
|
pyTooling ~= 8.7
|
||||||
|
|||||||
Reference in New Issue
Block a user