mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-15 20:46:55 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb36154250 | ||
|
|
fc08112235 | ||
|
|
953d0698c9 | ||
|
|
05e5d1f86c | ||
|
|
2eebeec719 | ||
|
|
5b97eaf241 | ||
|
|
1e694005ed | ||
|
|
46a2764e73 | ||
|
|
626d64ef6a | ||
|
|
fe4c9139c1 | ||
|
|
ae8a961e93 | ||
|
|
e4b5ea3895 | ||
|
|
b61f479180 | ||
|
|
9e6bbd52a6 | ||
|
|
438207a68d |
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 }}
|
||||
fi
|
||||
|
||||
- name: 🔧 Install wheel from artifact
|
||||
- name: 🔧 Install wheel from artifact (Ubuntu/macOS)
|
||||
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
|
||||
run: |
|
||||
ls -l install
|
||||
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)
|
||||
if: ( matrix.system != 'windows' && matrix.system != 'windows-arm' )
|
||||
run: |
|
||||
|
||||
13
.github/workflows/CompletePipeline.yml
vendored
13
.github/workflows/CompletePipeline.yml
vendored
@@ -93,6 +93,16 @@ on:
|
||||
required: false
|
||||
default: 'windows-arm:pypy-3.10 windows-arm:pypy-3.11'
|
||||
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:
|
||||
description: 'Publish merged coverage and unittest reports to Codecov.'
|
||||
required: false
|
||||
@@ -205,6 +215,8 @@ jobs:
|
||||
with:
|
||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
|
||||
bandit: ${{ inputs.bandit }}
|
||||
pylint: ${{ inputs.pylint }}
|
||||
artifact: CodeQuality
|
||||
|
||||
DocCoverage:
|
||||
@@ -219,7 +231,6 @@ jobs:
|
||||
uses: pyTooling/Actions/.github/workflows/Package.yml@main
|
||||
needs:
|
||||
- UnitTestingParams
|
||||
# - UnitTesting
|
||||
with:
|
||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||
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()
|
||||
typingCoberturaFile = Path("report/typing/cobertura.xml")
|
||||
typingJUnitFile = Path("report/typing/StaticTypingSummary.xml")
|
||||
typingHTMLDirectory = Path("htmlmypy")
|
||||
typingHTMLDirectory = Path("report/typing/html")
|
||||
|
||||
# Read output paths from 'pyproject.toml' file
|
||||
if coverageRC == "pyproject.toml":
|
||||
@@ -123,14 +123,34 @@ jobs:
|
||||
with pyProjectFile.open("rb") as file:
|
||||
pyProjectSettings = tomli_load(file)
|
||||
|
||||
unittestXMLFile = Path(pyProjectSettings["tool"]["pytest"]["junit_xml"])
|
||||
mergedUnittestXMLFile = Path(pyProjectSettings["tool"]["pyedaa-reports"]["junit_xml"])
|
||||
coverageHTMLDirectory = Path(pyProjectSettings["tool"]["coverage"]["html"]["directory"])
|
||||
coverageXMLFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
||||
coverageJSONFile= Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
||||
typingCoberturaFile = Path(pyProjectSettings["tool"]["mypy"]["cobertura_xml_report"]) / "cobertura.xml"
|
||||
typingJUnitFile = Path(pyProjectSettings["tool"]["mypy"]["junit_xml"])
|
||||
typingHTMLDirectory = Path(pyProjectSettings["tool"]["mypy"]["html_report"])
|
||||
toolSection = pyProjectSettings["tool"]
|
||||
if "pytest" in toolSection:
|
||||
section = toolSection["pytest"]
|
||||
if "junit_xml" in section:
|
||||
unittestXMLFile = Path(section["junit_xml"])
|
||||
|
||||
if "pyedaa-reports" in toolSection:
|
||||
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:
|
||||
print(f"File '{pyProjectFile}' not found.")
|
||||
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||
|
||||
2
.github/workflows/NightlyRelease.yml
vendored
2
.github/workflows/NightlyRelease.yml
vendored
@@ -304,7 +304,7 @@ jobs:
|
||||
if [[ -n "${downloadedArtifacts[$artifact]}" ]]; then
|
||||
printf " %s\n" "downloading '${artifact}' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}"
|
||||
else
|
||||
echo " downloading '${artifact}' ... "
|
||||
printf " downloading '${artifact}' ...\n"
|
||||
printf " %s" "gh run download $GITHUB_RUN_ID --dir \"${artifact}\" --name \"${artifact}\" "
|
||||
gh run download $GITHUB_RUN_ID --dir "${artifact}" --name "${artifact}"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
|
||||
4
.github/workflows/Parameters.yml
vendored
4
.github/workflows/Parameters.yml
vendored
@@ -164,7 +164,7 @@ jobs:
|
||||
package_name = "${{ inputs.package_name }}".strip()
|
||||
name = "${{ inputs.name }}".strip()
|
||||
|
||||
if package_namespace == "": # or package_namespace == ".":
|
||||
if package_namespace == "":
|
||||
package_fullname = package_name
|
||||
package_directory = package_name
|
||||
elif package_namespace[-2:] == ".*":
|
||||
@@ -260,7 +260,7 @@ jobs:
|
||||
|
||||
currentMSYS2Version = "3.12"
|
||||
currentAlphaVersion = "3.14"
|
||||
currentAlphaRelease = "3.14.0-rc.2"
|
||||
currentAlphaRelease = "3.14.0-rc.3"
|
||||
|
||||
if systems == "":
|
||||
print("::error title=Parameter::system_list is empty.")
|
||||
|
||||
271
.github/workflows/PrepareJob.yml
vendored
271
.github/workflows/PrepareJob.yml
vendored
@@ -35,15 +35,18 @@ on:
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
on_default_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.on_default_branch }}
|
||||
on_main_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.on_main_branch }}
|
||||
on_dev_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.on_dev_branch }}
|
||||
on_release_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.on_release_branch }}
|
||||
on_dev_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.on_dev_branch }}
|
||||
is_regular_commit:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.is_regular_commit }}
|
||||
@@ -59,9 +62,15 @@ on:
|
||||
is_release_tag:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.is_release_tag }}
|
||||
has_submodules:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.has_submodules }}
|
||||
ref_kind:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.ref_kind }}
|
||||
default_branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.default_branch }}
|
||||
branch:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.branch }}
|
||||
@@ -83,27 +92,42 @@ on:
|
||||
# pr_mergedat:
|
||||
# description: ""
|
||||
# value: ${{ jobs.Prepare.outputs.pr_mergedat }}
|
||||
git_submodule_count:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.git_submodule_count }}
|
||||
git_submodule_names:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.git_submodule_names }}
|
||||
git_submodule_paths:
|
||||
description: ""
|
||||
value: ${{ jobs.Prepare.outputs.git_submodule_paths }}
|
||||
|
||||
jobs:
|
||||
Prepare:
|
||||
name: Extract Information
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
|
||||
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
|
||||
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
|
||||
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
|
||||
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
|
||||
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
|
||||
is_nightly_tag: ${{ steps.Classify.outputs.is_nightly_tag }}
|
||||
is_release_tag: ${{ steps.Classify.outputs.is_release_tag }}
|
||||
ref_kind: ${{ steps.Classify.outputs.ref_kind }}
|
||||
branch: ${{ steps.Classify.outputs.branch }}
|
||||
tag: ${{ steps.Classify.outputs.tag }}
|
||||
version: ${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}
|
||||
# release_version: ${{ steps.FindPullRequest.outputs.release_version }}
|
||||
pr_title: ${{ steps.FindPullRequest.outputs.pr_title }}
|
||||
pr_number: ${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}
|
||||
on_default_branch: ${{ steps.Classify.outputs.on_default_branch }}
|
||||
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
|
||||
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
|
||||
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
|
||||
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
|
||||
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
|
||||
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
|
||||
is_nightly_tag: ${{ steps.Classify.outputs.is_nightly_tag }}
|
||||
is_release_tag: ${{ steps.Classify.outputs.is_release_tag }}
|
||||
has_submodules: ${{ steps.Classify.outputs.has_submodules }}
|
||||
ref_kind: ${{ steps.Classify.outputs.ref_kind }}
|
||||
default_branch: ${{ steps.Classify.outputs.default_branch }}
|
||||
branch: ${{ steps.Classify.outputs.branch }}
|
||||
tag: ${{ steps.Classify.outputs.tag }}
|
||||
version: ${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}
|
||||
# release_version: ${{ steps.FindPullRequest.outputs.release_version }}
|
||||
pr_title: ${{ steps.FindPullRequest.outputs.pr_title }}
|
||||
pr_number: ${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}
|
||||
git_submodule_count: ${{ steps.Classify.outputs.git_submodule_count }}
|
||||
git_submodule_names: ${{ steps.Classify.outputs.git_submodule_names }}
|
||||
git_submodule_paths: ${{ steps.Classify.outputs.git_submodule_paths }}
|
||||
|
||||
steps:
|
||||
- name: ⏬ Checkout repository
|
||||
@@ -132,89 +156,133 @@ jobs:
|
||||
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||
ANSI_NOCOLOR=$'\x1b[0m'
|
||||
|
||||
export GH_TOKEN=${{ github.token }}
|
||||
|
||||
ref="${{ github.ref }}"
|
||||
on_default_branch="false"
|
||||
on_main_branch="false"
|
||||
on_dev_branch="false"
|
||||
on_release_branch="false"
|
||||
on_dev_branch="false"
|
||||
is_regular_commit="false"
|
||||
is_merge_commit="false"
|
||||
is_release_commit="false"
|
||||
is_nightly_tag="false"
|
||||
is_release_tag="false"
|
||||
has_submodules="false"
|
||||
ref_kind="unknown"
|
||||
default_branch=""
|
||||
branch=""
|
||||
tag=""
|
||||
pr_number=""
|
||||
version=""
|
||||
git_submodule_count="0"
|
||||
git_submodule_names=""
|
||||
git_submodule_paths=""
|
||||
|
||||
printf "Classify Git reference '%s' " "${ref}"
|
||||
if [[ "${ref:0:11}" == "refs/heads/" ]]; then
|
||||
printf "${ANSI_LIGHT_GREEN}[BRANCH]\n"
|
||||
ref_kind="branch"
|
||||
branch="${ref:11}"
|
||||
|
||||
printf "Commit check:\n"
|
||||
printf "Get default branch name ... "
|
||||
defaultBranch=$(gh repo view "${{ github.repository }}" --json defaultBranchRef --jq '.defaultBranchRef.name' 2>&1)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
printf "${ANSI_LIGHT_GREEN} [OK]\n"
|
||||
|
||||
default_branch="${defaultBranch}"
|
||||
printf " Default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${default_branch}"
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED} [FAILED]\n"
|
||||
printf " ${ANSI_LIGHT_RED}%s${ANSI_NOCOLOR}\n" "${default_branch}"
|
||||
fi
|
||||
|
||||
printf "Commit checks:\n"
|
||||
printf " Commit: %s\n" "${{ github.sha }}"
|
||||
printf " Commit kind "
|
||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||
is_regular_commit="true"
|
||||
printf "${ANSI_LIGHT_YELLOW}[REGULAR]${ANSI_NOCOLOR}\n"
|
||||
else
|
||||
is_merge_commit="true"
|
||||
printf "${ANSI_LIGHT_GREEN}[MERGE]${ANSI_NOCOLOR}\n"
|
||||
fi
|
||||
|
||||
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
|
||||
on_default_branch="true"
|
||||
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||
fi
|
||||
|
||||
printf " Commit on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.main_branch }}"
|
||||
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
|
||||
on_main_branch="true"
|
||||
|
||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||
is_regular_commit="true"
|
||||
printf " ${ANSI_LIGHT_YELLOW}regular "
|
||||
else
|
||||
is_merge_commit="true"
|
||||
printf " ${ANSI_LIGHT_GREEN}merge "
|
||||
fi
|
||||
printf "commit${ANSI_NOCOLOR} on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
|
||||
fi
|
||||
|
||||
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
||||
on_dev_branch="true"
|
||||
|
||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||
is_regular_commit="true"
|
||||
printf " ${ANSI_LIGHT_YELLOW}regular "
|
||||
else
|
||||
is_merge_commit="true"
|
||||
printf " ${ANSI_LIGHT_GREEN}merge "
|
||||
fi
|
||||
printf "commit${ANSI_NOCOLOR} 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
|
||||
|
||||
printf " Commit on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.release_branch }}"
|
||||
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
||||
on_release_branch="true"
|
||||
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||
fi
|
||||
|
||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||
is_regular_commit="true"
|
||||
printf " ${ANSI_LIGHT_YELLOW}regular "
|
||||
else
|
||||
printf " Commit on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR} " "${{ inputs.development_branch }}"
|
||||
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
||||
on_dev_branch="true"
|
||||
printf "${ANSI_LIGHT_GREEN}[YES]${ANSI_NOCOLOR}\n"
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED}[NO]${ANSI_NOCOLOR}\n"
|
||||
fi
|
||||
|
||||
if [[ "${is_merge_commit}" == "true" ]]; then
|
||||
printf "Release checks:\n"
|
||||
printf " Release kind "
|
||||
if [[ "${on_main_branch}" == "true" ]]; then
|
||||
is_release_commit="true"
|
||||
printf " ${ANSI_LIGHT_GREEN}release "
|
||||
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
||||
elif [[ "${on_version_branch}" == "true" ]]; then
|
||||
is_release_commit="true"
|
||||
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
||||
elif [[ "${on_release_branch}" == "true" ]]; then
|
||||
is_prerelease_commit="true"
|
||||
printf "${ANSI_LIGHT_YELLOW}[PRERELEASE]${ANSI_NOCOLOR}\n"
|
||||
fi
|
||||
printf "commit${ANSI_NOCOLOR} on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
|
||||
fi
|
||||
elif [[ "${ref:0:10}" == "refs/tags/" ]]; then
|
||||
printf "${ANSI_LIGHT_GREEN}[TAG]\n"
|
||||
ref_kind="tag"
|
||||
tag="${ref:10}"
|
||||
|
||||
printf "Tag check:\n"
|
||||
|
||||
printf " Check if tag is on release branch '%s' ... " "${{ inputs.release_branch }}"
|
||||
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.release_branch }}" > /dev/null
|
||||
printf "Tag checks:\n"
|
||||
printf " Check if 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.release_branch }}"
|
||||
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.release_branch }}"
|
||||
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
|
||||
|
||||
NIGHTLY_TAG_PATTERN='^${{ inputs.nightly_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"
|
||||
is_nightly_tag="true"
|
||||
elif [[ "${tag}" =~ $RELEASE_TAG_PATTERN ]]; then
|
||||
elif [[ "${tag}" =~ ${RELEASE_TAG_PATTERN} ]]; then
|
||||
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
||||
version="${tag}"
|
||||
is_release_tag="true"
|
||||
@@ -226,33 +294,75 @@ jobs:
|
||||
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
|
||||
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
|
||||
printf "${ANSI_LIGHT_YELLOW}[PULL REQUEST]\n"
|
||||
ref_kind="pullrequest"
|
||||
pr_number=${ref:11}
|
||||
pr_number=${pr_number%%/*}
|
||||
|
||||
printf "Pull Request check:\n"
|
||||
printf "Pull Request checks:\n"
|
||||
printf " Number: %s\n" "${pr_number}"
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED}[UNKNOWN]\n"
|
||||
printf "${ANSI_LIGHT_RED}Unknown Git reference '%s'.${ANSI_NOCOLOR}\n" "${{ github.ref }}"
|
||||
printf "::error title=Classify Commit::Unknown Git reference '%s'.\n" "${{ github.ref }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Submodules
|
||||
if [[ -f .gitsubmodules ]]; then
|
||||
has_submodules="true"
|
||||
git_modules_file=.gitmodules # $(git rev-parse --show-toplevel)/.gitmodules
|
||||
git_submodule_count="$(grep -Po '(?<=\[submodule \")(.*)(?=\"\])' "${git_modules_file}" | wc -l)"
|
||||
git_submodule_names="$(grep -Po '(?<=\[submodule \")(.*)(?=\"\])' "${git_modules_file}" | paste -sd ':' -)"
|
||||
git_submodule_paths="$(git config --file "${git_modules_file}" --null --name-only --get-regexp '\.path$' | xargs -0 -n1 git config --file "${git_modules_file}" --get | paste -sd ':' -)"
|
||||
fi
|
||||
|
||||
printf "\nWriting output variables ...\n"
|
||||
tee --append "${GITHUB_OUTPUT}" <<EOF
|
||||
on_default_branch=${on_default_branch}
|
||||
on_main_branch=${on_main_branch}
|
||||
on_dev_branch=${on_dev_branch}
|
||||
on_release_branch=${on_release_branch}
|
||||
on_dev_branch=${on_dev_branch}
|
||||
is_regular_commit=${is_regular_commit}
|
||||
is_merge_commit=${is_merge_commit}
|
||||
is_release_commit=${is_release_commit}
|
||||
is_nightly_tag=${is_nightly_tag}
|
||||
is_release_tag=${is_release_tag}
|
||||
has_submodules=${has_submodules}
|
||||
ref_kind=${ref_kind}
|
||||
default_branch=${default_branch}
|
||||
branch=${branch}
|
||||
tag=${tag}
|
||||
pr_number=${pr_number}
|
||||
version=${version}
|
||||
git_submodule_count=${git_submodule_count}
|
||||
git_submodule_names=${git_submodule_names}
|
||||
git_submodule_paths=${git_submodule_paths}
|
||||
EOF
|
||||
|
||||
# TODO: why not is_release_commit?
|
||||
@@ -328,21 +438,28 @@ jobs:
|
||||
|
||||
- name: Debug
|
||||
run: |
|
||||
printf "on_main_branch: %s\n" "${{ steps.Classify.outputs.on_main_branch }}"
|
||||
printf "on_dev_branch: %s\n" "${{ steps.Classify.outputs.on_dev_branch }}"
|
||||
printf "on_release_branch: %s\n" "${{ steps.Classify.outputs.on_release_branch }}"
|
||||
printf "is_regular_commit: %s\n" "${{ steps.Classify.outputs.is_regular_commit }}"
|
||||
printf "is_merge_commit: %s\n" "${{ steps.Classify.outputs.is_merge_commit }}"
|
||||
printf "is_release_commit: %s\n" "${{ steps.Classify.outputs.is_release_commit }}"
|
||||
printf "is_nightly_tag: %s\n" "${{ steps.Classify.outputs.is_nightly_tag }}"
|
||||
printf "is_release_tag: %s\n" "${{ steps.Classify.outputs.is_release_tag }}"
|
||||
printf "ref_kind: %s\n" "${{ steps.Classify.outputs.ref_kind }}"
|
||||
printf "branch: %s\n" "${{ steps.Classify.outputs.branch }}"
|
||||
printf "tag: %s\n" "${{ steps.Classify.outputs.tag }}"
|
||||
printf "version: %s\n" "${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}"
|
||||
printf " from tag: %s\n" "${{ steps.Classify.outputs.version }}"
|
||||
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_version }}"
|
||||
printf "pr title: %s\n" "${{ steps.FindPullRequest.outputs.pr_title }}"
|
||||
printf "pr number: %s\n" "${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}"
|
||||
printf " from merge: %s\n" "${{ steps.Classify.outputs.pr_number }}"
|
||||
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_number }}"
|
||||
printf "on_default_branch: %s\n" "${{ steps.Classify.outputs.on_default_branch }}"
|
||||
printf "on_main_branch: %s\n" "${{ steps.Classify.outputs.on_main_branch }}"
|
||||
printf "on_release_branch: %s\n" "${{ steps.Classify.outputs.on_release_branch }}"
|
||||
printf "on_dev_branch: %s\n" "${{ steps.Classify.outputs.on_dev_branch }}"
|
||||
printf "is_regular_commit: %s\n" "${{ steps.Classify.outputs.is_regular_commit }}"
|
||||
printf "is_merge_commit: %s\n" "${{ steps.Classify.outputs.is_merge_commit }}"
|
||||
printf "is_release_commit: %s\n" "${{ steps.Classify.outputs.is_release_commit }}"
|
||||
printf "is_nightly_tag: %s\n" "${{ steps.Classify.outputs.is_nightly_tag }}"
|
||||
printf "is_release_tag: %s\n" "${{ steps.Classify.outputs.is_release_tag }}"
|
||||
printf "has_submodules: %s\n" "${{ steps.Classify.outputs.has_submodules }}"
|
||||
printf "ref_kind: %s\n" "${{ steps.Classify.outputs.ref_kind }}"
|
||||
printf "default_branch: %s\n" "${{ steps.Classify.outputs.default_branch }}"
|
||||
printf "branch: %s\n" "${{ steps.Classify.outputs.branch }}"
|
||||
printf "tag: %s\n" "${{ steps.Classify.outputs.tag }}"
|
||||
printf "version: %s\n" "${{ steps.Classify.outputs.version || steps.FindPullRequest.outputs.pr_version }}"
|
||||
printf " from tag: %s\n" "${{ steps.Classify.outputs.version }}"
|
||||
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_version }}"
|
||||
printf "pr title: %s\n" "${{ steps.FindPullRequest.outputs.pr_title }}"
|
||||
printf "pr number: %s\n" "${{ steps.Classify.outputs.pr_number || steps.FindPullRequest.outputs.pr_number }}"
|
||||
printf " from merge: %s\n" "${{ steps.Classify.outputs.pr_number }}"
|
||||
printf " from pr: %s\n" "${{ steps.FindPullRequest.outputs.pr_number }}"
|
||||
printf "git_submodule_*:\n"
|
||||
printf " *_count_: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_count }}"
|
||||
printf " *_names: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_names }}"
|
||||
printf " *_paths: %s\n" "${{ steps.FindPullRequest.outputs.git_submodule_paths }}"
|
||||
|
||||
42
.github/workflows/PublishReleaseNotes.yml
vendored
42
.github/workflows/PublishReleaseNotes.yml
vendored
@@ -249,7 +249,7 @@ jobs:
|
||||
printf " %s\n" "MergedAt: ${PR_MERGED_AT} ($(date -d"${PR_MERGED_AT}" '+%d.%m.%Y - %H:%M:%S'))"
|
||||
fi
|
||||
|
||||
echo "${PR_BODY}" > __PULLREQUEST__.md
|
||||
printf "%s\n" "${PR_BODY}" > __PULLREQUEST__.md
|
||||
fi
|
||||
|
||||
# Check if a release description file should be used and exists.
|
||||
@@ -353,7 +353,7 @@ jobs:
|
||||
NOTES="${NOTES//%%datetime%%/$(date '+%Y-%m-%d %H:%M:%S %Z')}"
|
||||
|
||||
# Write final release notes to file
|
||||
echo "${NOTES}" > __NOTES__.md
|
||||
printf "%s\n" "${NOTES}" > __NOTES__.md
|
||||
|
||||
# Display partial contents for debugging
|
||||
if [[ -s __DESCRIPTION__.md ]]; then
|
||||
@@ -496,7 +496,28 @@ jobs:
|
||||
|
||||
# Create JSON inventory
|
||||
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||
VERSION="1.0"
|
||||
STRUCT_VERSION="1.1"
|
||||
|
||||
# Use GitHub API to ask for latest version
|
||||
printf "Get latest released version via GitHub API ...\n"
|
||||
printf " gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName' "
|
||||
latestVersion=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName')
|
||||
if [[ $? -eq 0 ]]; then
|
||||
if [[ -z "${latestVersion}" ]]; then
|
||||
printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n"
|
||||
printf " latest=unknown\n"
|
||||
latestVersion="unknown"
|
||||
else
|
||||
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||
printf " latest=%s\n" "${latestVersion}"
|
||||
fi
|
||||
else
|
||||
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||
printf " ${ANSI_LIGHT_RED}Couldn't get latest released version '%s'.${ANSI_NOCOLOR}\n" "${latestVersion}"
|
||||
printf "::error title=%s::%s\n" "GitHub Release API" "Couldn't get latest released version '${latestVersion}'."
|
||||
|
||||
latestVersion="error"
|
||||
fi
|
||||
|
||||
# Split categories by ',' into a Bash array.
|
||||
# See https://stackoverflow.com/a/45201229/3719459
|
||||
@@ -509,21 +530,26 @@ jobs:
|
||||
fi
|
||||
|
||||
jsonInventory=$(jq -c -n \
|
||||
--arg version "${VERSION}" \
|
||||
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
|
||||
--arg structVersion "${STRUCT_VERSION}" \
|
||||
--arg date "$(date +"%Y-%m-%dT%H:%M:%S%:z")" \
|
||||
--argjson jsonMeta "$(jq -c -n \
|
||||
--arg tag "${{ inputs.tag }}" \
|
||||
--arg version "${{ inputs.inventory-version }}" \
|
||||
--arg hash "${{ github.sha }}" \
|
||||
--arg repo "${{ github.server_url }}/${{ github.repository }}" \
|
||||
--arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.tag }}" \
|
||||
--argjson jsonLatest "$(jq -c -n \
|
||||
--arg version "${latestVersion}" \
|
||||
--arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${latestVersion}" \
|
||||
'{"version": $version, "release-url": $release}' \
|
||||
)" \
|
||||
--argjson categories "$(jq -c -n \
|
||||
'$ARGS.positional' \
|
||||
--args "${inventoryCategories[@]}" \
|
||||
)" \
|
||||
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories}' \
|
||||
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \
|
||||
)" \
|
||||
'{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||
'{"version": "$structVersion", "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||
)
|
||||
fi
|
||||
|
||||
@@ -577,7 +603,7 @@ jobs:
|
||||
if [[ -n "${downloadedArtifacts[$artifact]}" ]]; then
|
||||
printf " downloading artifact '%s' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n" "${artifact}"
|
||||
else
|
||||
echo " downloading '${artifact}' ... "
|
||||
printf " downloading '${artifact}' ...\n"
|
||||
printf " gh run download $GITHUB_RUN_ID --dir \"%s\" --name \"%s\" " "${artifact}" "${artifact}"
|
||||
gh run download $GITHUB_RUN_ID --dir "${artifact}" --name "${artifact}"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
|
||||
2
dist/requirements.txt
vendored
2
dist/requirements.txt
vendored
@@ -1,2 +1,2 @@
|
||||
wheel ~= 0.45
|
||||
twine ~= 6.1
|
||||
twine ~= 6.2
|
||||
|
||||
@@ -164,7 +164,7 @@ Example Pipelines
|
||||
.. code-block:: toml
|
||||
|
||||
[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"
|
||||
|
||||
[tool.mypy]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-r ../requirements.txt
|
||||
|
||||
pyTooling ~= 8.5
|
||||
pyTooling ~= 8.7
|
||||
|
||||
# Enforce latest version on ReadTheDocs
|
||||
sphinx ~= 8.2
|
||||
@@ -13,7 +13,7 @@ sphinx_rtd_theme ~= 3.0
|
||||
# Sphinx Extenstions
|
||||
sphinxcontrib-mermaid ~= 1.0
|
||||
autoapi >= 2.0.1
|
||||
sphinx_design ~= 0.6.1
|
||||
sphinx-copybutton >= 0.5.2
|
||||
sphinx_design ~= 0.6
|
||||
sphinx-copybutton >= 0.5
|
||||
sphinx_autodoc_typehints ~= 3.2
|
||||
sphinx_reports ~= 0.9
|
||||
|
||||
@@ -40,6 +40,7 @@ __version__ = "0.4.5"
|
||||
__keywords__ = ["GitHub Actions"]
|
||||
__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues"
|
||||
|
||||
from pickle import dumps
|
||||
from subprocess import check_call
|
||||
|
||||
from pyTooling.Decorators import export, readonly
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
requires = [
|
||||
"setuptools >= 80.0",
|
||||
"wheel ~= 0.45",
|
||||
"pyTooling ~= 8.5"
|
||||
"pyTooling ~= 8.7"
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.pylint.format]
|
||||
indent-string="\t"
|
||||
max-line-length = 120
|
||||
ignore-long-lines = "^.{0,110}#: .*"
|
||||
|
||||
[tool.pylint.basic]
|
||||
argument-naming-style = "camelCase"
|
||||
|
||||
@@ -1 +1 @@
|
||||
pyTooling ~= 8.5
|
||||
pyTooling ~= 8.7
|
||||
|
||||
Reference in New Issue
Block a user