mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-15 12:36:56 +08:00
Compare commits
207 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b0b103c5f | ||
|
|
ba6f55dd57 | ||
|
|
d48de1d02d | ||
|
|
744f08b9bf | ||
|
|
fb546453ae | ||
|
|
1a3ba03626 | ||
|
|
4d2d4c47fc | ||
|
|
962827936c | ||
|
|
2307b526df | ||
|
|
f3e2e42ae3 | ||
|
|
2f7fa88c36 | ||
|
|
2ee14e88a2 | ||
|
|
68f708d79c | ||
|
|
034d27d4a3 | ||
|
|
5891636ec9 | ||
|
|
330a21e6c3 | ||
|
|
bdf8239a73 | ||
|
|
68357fddd8 | ||
|
|
4addce16fa | ||
|
|
2f4ccf2af4 | ||
|
|
0b6462f4d2 | ||
|
|
b0198fa459 | ||
|
|
05808d4058 | ||
|
|
7a57747fcd | ||
|
|
3f7b0c221b | ||
|
|
4ebf262921 | ||
|
|
f015e1c3a0 | ||
|
|
9e6138b5a9 | ||
|
|
39ae93c200 | ||
|
|
1b6454ba91 | ||
|
|
12389ac0f0 | ||
|
|
c1f0e4a16b | ||
|
|
8d0c46d6b5 | ||
|
|
70f5fe1fc8 | ||
|
|
a1309f9f42 | ||
|
|
8e94b774da | ||
|
|
aaf283515b | ||
|
|
f10daa2e2c | ||
|
|
27d45b9766 | ||
|
|
33edd82e6f | ||
|
|
d08f312904 | ||
|
|
731d0d2369 | ||
|
|
de400ae2db | ||
|
|
cb3c338df6 | ||
|
|
79c8526437 | ||
|
|
0f7d062c38 | ||
|
|
d5635a8842 | ||
|
|
6aa6af95ee | ||
|
|
15bf375fe6 | ||
|
|
a1b03cfe2a | ||
|
|
79620e267d | ||
|
|
fffef5c814 | ||
|
|
42e17fae05 | ||
|
|
9b7032a585 | ||
|
|
9110c85738 | ||
|
|
c81d139080 | ||
|
|
c64e054bcd | ||
|
|
78fdb584aa | ||
|
|
a456635686 | ||
|
|
befc59f22d | ||
|
|
d6fc0efd47 | ||
|
|
c018acc3c1 | ||
|
|
d74c610bb4 | ||
|
|
edc4ab3e86 | ||
|
|
0a338ae8b7 | ||
|
|
4069da0a74 | ||
|
|
679ec24c80 | ||
|
|
3a13486ea6 | ||
|
|
34fb9c9869 | ||
|
|
7523c4adca | ||
|
|
530ad7a4a1 | ||
|
|
bd3f2afaf3 | ||
|
|
b1e4cb961f | ||
|
|
1e6b71e87b | ||
|
|
5d8a608893 | ||
|
|
c3b7b3ca64 | ||
|
|
f61b77ee72 | ||
|
|
5f18024dd4 | ||
|
|
d0f07e1af4 | ||
|
|
2b5a9bdeff | ||
|
|
d324bdacee | ||
|
|
9296bd6e7d | ||
|
|
c37f727e2d | ||
|
|
a4559e8e63 | ||
|
|
bc94fba95e | ||
|
|
d6ec94fea7 | ||
|
|
4bc4ec5cf4 | ||
|
|
e21f89670a | ||
|
|
c13dd2521c | ||
|
|
cf2e89a622 | ||
|
|
a9a3c400fd | ||
|
|
970b4ae021 | ||
|
|
1807741b0a | ||
|
|
cf095afe77 | ||
|
|
12991ee38a | ||
|
|
70134b31c3 | ||
|
|
38514a9005 | ||
|
|
9ceefdbf5d | ||
|
|
b1bc6e50a3 | ||
|
|
fdee9e011f | ||
|
|
3e50c2ed5b | ||
|
|
9e0b1c69f1 | ||
|
|
f084e02f01 | ||
|
|
c34d4e240e | ||
|
|
6d04009bd6 | ||
|
|
50d32d1950 | ||
|
|
7733e8998f | ||
|
|
4c28b9d003 | ||
|
|
bafea7d082 | ||
|
|
9ca7b04f37 | ||
|
|
7a0ee75fd5 | ||
|
|
bc876f7171 | ||
|
|
edca070047 | ||
|
|
21c2f48dad | ||
|
|
9338fbd106 | ||
|
|
6869d0f666 | ||
|
|
bef77effcb | ||
|
|
9808b6c7f9 | ||
|
|
e7e95b446d | ||
|
|
df0889b86b | ||
|
|
87978fd1f6 | ||
|
|
3e95c89362 | ||
|
|
f737b07992 | ||
|
|
77a6b4c00a | ||
|
|
ef5c852097 | ||
|
|
bec076bd66 | ||
|
|
c924651632 | ||
|
|
b9b9b0b1d4 | ||
|
|
1cef082753 | ||
|
|
c3a999c754 | ||
|
|
9760023567 | ||
|
|
fbbb39046a | ||
|
|
1d0c8b36e8 | ||
|
|
c9d0e8e9c6 | ||
|
|
00269cf507 | ||
|
|
a15499a807 | ||
|
|
13076012dd | ||
|
|
b2ac6bc0d9 | ||
|
|
e88aa7b973 | ||
|
|
855d432978 | ||
|
|
bf6ba9ba19 | ||
|
|
93cdeb9cba | ||
|
|
72a8705e6c | ||
|
|
ea96cce0d1 | ||
|
|
59ce0fa84a | ||
|
|
c8362d99cc | ||
|
|
0e9d878f0e | ||
|
|
5d67896606 | ||
|
|
4b058faf3e | ||
|
|
474a8024d1 | ||
|
|
5dc19a5d65 | ||
|
|
188feb556b | ||
|
|
d58db55086 | ||
|
|
ee9a3fbdcd | ||
|
|
8dfc484c42 | ||
|
|
960b7089e7 | ||
|
|
706ef39595 | ||
|
|
04881fc4ca | ||
|
|
e444e57112 | ||
|
|
cea83bc2ae | ||
|
|
440553e7fb | ||
|
|
26461822b5 | ||
|
|
7a341dbe8f | ||
|
|
33b99a3b4e | ||
|
|
5e0aa52e5d | ||
|
|
2862238ee5 | ||
|
|
ebd20f5aea | ||
|
|
2004711d48 | ||
|
|
02d386a9e1 | ||
|
|
e0af5055a8 | ||
|
|
cc1dade947 | ||
|
|
b87d11502b | ||
|
|
fa96ee9197 | ||
|
|
0495bfb18c | ||
|
|
f62d5d93ea | ||
|
|
13c1a56f92 | ||
|
|
da3cdbe96a | ||
|
|
5fe793e3fa | ||
|
|
c38ff2af3c | ||
|
|
98f0fffaf6 | ||
|
|
0fef6f8a4d | ||
|
|
92ce834303 | ||
|
|
607637b278 | ||
|
|
dfc9221529 | ||
|
|
d4afc820ab | ||
|
|
ae13aa2dff | ||
|
|
7879c05ab7 | ||
|
|
df4815f666 | ||
|
|
8b7a8009a6 | ||
|
|
6b4af68fa4 | ||
|
|
0db1821658 | ||
|
|
6d84311338 | ||
|
|
4406abe788 | ||
|
|
e9d0dc3dba | ||
|
|
f9a74102d9 | ||
|
|
b33e0f2782 | ||
|
|
ae32d20719 | ||
|
|
c3c6a09a9b | ||
|
|
87fa2b693a | ||
|
|
be27e58d8c | ||
|
|
6d039bba90 | ||
|
|
0753edca95 | ||
|
|
461931099a | ||
|
|
0802f6d02f | ||
|
|
3b95a36955 | ||
|
|
583eed8c84 | ||
|
|
0e567aebc4 |
9
.btd.yml
9
.btd.yml
@@ -1,9 +0,0 @@
|
|||||||
input: doc
|
|
||||||
output: _build
|
|
||||||
requirements: requirements.txt
|
|
||||||
target: gh-pages
|
|
||||||
formats: [ html ]
|
|
||||||
images:
|
|
||||||
base: btdi/sphinx:pytooling
|
|
||||||
latex: btdi/latex
|
|
||||||
theme: https://codeload.GitHub.com/buildthedocs/sphinx.theme/tar.gz/v1
|
|
||||||
3
.github/CODEOWNERS
vendored
Normal file
3
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
* @Paebbels
|
||||||
|
|
||||||
|
/.github/ @Paebbels
|
||||||
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -10,9 +10,5 @@ updates:
|
|||||||
- Dependencies
|
- Dependencies
|
||||||
assignees:
|
assignees:
|
||||||
- Paebbels
|
- Paebbels
|
||||||
- umarcor
|
|
||||||
reviewers:
|
|
||||||
- Paebbels
|
|
||||||
- umarcor
|
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily" # Checks on Monday trough Friday.
|
interval: "daily" # Checks on Monday trough Friday.
|
||||||
|
|||||||
20
.github/pull_request_template.md
vendored
20
.github/pull_request_template.md
vendored
@@ -1,16 +1,30 @@
|
|||||||
# New Features
|
# New Features
|
||||||
|
|
||||||
|
* tbd
|
||||||
* tbd
|
* tbd
|
||||||
|
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
* tbd
|
||||||
* tbd
|
* tbd
|
||||||
|
|
||||||
# Bug Fixes
|
# Bug Fixes
|
||||||
|
|
||||||
|
* tbd
|
||||||
* tbd
|
* tbd
|
||||||
|
|
||||||
----------
|
# Documentation
|
||||||
# Related PRs:
|
|
||||||
|
|
||||||
* tbd
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
# Unit Tests
|
||||||
|
|
||||||
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
----------
|
||||||
|
# Related Issues and Pull-Requests
|
||||||
|
|
||||||
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|||||||
58
.github/workflows/ApplicationTesting.yml
vendored
58
.github/workflows/ApplicationTesting.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -86,10 +86,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.wheel }}' from 'Package' job
|
- name: 📥 Download artifacts '${{ inputs.wheel }}' from 'Package' job
|
||||||
uses: actions/download-artifact@v4
|
uses: pyTooling/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.wheel }}
|
name: ${{ inputs.wheel }}
|
||||||
path: install
|
path: install
|
||||||
@@ -124,26 +124,35 @@ jobs:
|
|||||||
requirements = "${{ inputs.requirements }}"
|
requirements = "${{ inputs.requirements }}"
|
||||||
if requirements.startswith("-r"):
|
if requirements.startswith("-r"):
|
||||||
requirementsFile = Path(requirements[2:].lstrip())
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
dependencies = loadRequirementsFile(requirementsFile)
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFoundError::{ex}")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
dependencies = [req.strip() for req in requirements.split(" ")]
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
"coverage": "python-coverage:p",
|
"coverage": "python-coverage:p",
|
||||||
"igraph": "igraph:p",
|
"docstr_coverage": "python-pyyaml:p python-types-pyyaml:p",
|
||||||
"jinja2": "python-markupsafe:p",
|
"igraph": "igraph:p",
|
||||||
"lxml": "python-lxml:p",
|
"jinja2": "python-markupsafe:p",
|
||||||
"numpy": "python-numpy:p",
|
"lxml": "python-lxml:p",
|
||||||
"markupsafe": "python-markupsafe:p",
|
"numpy": "python-numpy:p",
|
||||||
"pip": "python-pip:p",
|
"markupsafe": "python-markupsafe:p",
|
||||||
"ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
"pip": "python-pip:p",
|
||||||
"sphinx": "python-markupsafe:p",
|
"pyyaml": "python-pyyaml:p python-types-pyyaml:p",
|
||||||
"tomli": "python-tomli:p",
|
"ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
"wheel": "python-wheel:p",
|
"sphinx": "python-markupsafe:p",
|
||||||
|
"tomli": "python-tomli:p",
|
||||||
|
"wheel": "python-wheel:p",
|
||||||
|
"pyEDAA.ProjectModel": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
"pyEDAA.Reports": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
"sphinx-reports": "python-markupsafe:p python-pyaml:p python-types-pyyaml:p",
|
||||||
}
|
}
|
||||||
subPackages = {
|
subPackages = {
|
||||||
"pytooling": {
|
"pytooling": {
|
||||||
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,8 +189,8 @@ jobs:
|
|||||||
f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
||||||
|
|
||||||
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
|
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
|
||||||
if: matrix.system == 'msys2'
|
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
|
if: matrix.system == 'msys2'
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.runtime }}
|
msystem: ${{ matrix.runtime }}
|
||||||
update: true
|
update: true
|
||||||
@@ -190,8 +199,8 @@ jobs:
|
|||||||
${{ inputs.pacboy }}
|
${{ inputs.pacboy }}
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ matrix.python }}
|
- name: 🐍 Setup Python ${{ matrix.python }}
|
||||||
if: matrix.system != 'msys2'
|
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
if: matrix.system != 'msys2'
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
@@ -215,7 +224,7 @@ jobs:
|
|||||||
ls -l install
|
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: ☑ Run application tests (Ubuntu/macOS)
|
- name: ✅ Run application tests (Ubuntu/macOS)
|
||||||
if: matrix.system != 'windows'
|
if: matrix.system != 'windows'
|
||||||
run: |
|
run: |
|
||||||
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
||||||
@@ -223,14 +232,14 @@ jobs:
|
|||||||
cd "${{ inputs.root_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
[ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
[ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
||||||
if [ -n '${{ inputs.coverage_config }}' ]; then
|
if [ -n '${{ inputs.coverage_config }}' ]; then
|
||||||
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
printf "%s\n" "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
||||||
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}
|
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}
|
||||||
else
|
else
|
||||||
echo "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
printf "%s\n" "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
||||||
python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}
|
python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: ☑ Run application tests (Windows)
|
- name: ✅ Run application tests (Windows)
|
||||||
if: matrix.system == 'windows'
|
if: matrix.system == 'windows'
|
||||||
run: |
|
run: |
|
||||||
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
||||||
@@ -247,9 +256,10 @@ jobs:
|
|||||||
|
|
||||||
- name: 📤 Upload 'TestReportSummary.xml' artifact
|
- name: 📤 Upload 'TestReportSummary.xml' artifact
|
||||||
if: inputs.apptest_xml_artifact != ''
|
if: inputs.apptest_xml_artifact != ''
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: report/unit/TestReportSummary.xml
|
working-directory: report/unit
|
||||||
|
path: TestReportSummary.xml
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
17
.github/workflows/ArtifactCleanUp.yml
vendored
17
.github/workflows/ArtifactCleanUp.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,6 +25,11 @@ name: ArtifactCleanUp
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
package:
|
package:
|
||||||
description: 'Artifacts to be removed on not tagged runs.'
|
description: 'Artifacts to be removed on not tagged runs.'
|
||||||
required: true
|
required: true
|
||||||
@@ -36,23 +41,19 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
ArtifactCleanUp:
|
ArtifactCleanUp:
|
||||||
name: 🗑️ Artifact Cleanup
|
name: 🗑️ Artifact Cleanup
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: 🗑️ Delete package Artifacts
|
- name: 🗑️ Delete package Artifacts
|
||||||
|
uses: geekyeggo/delete-artifact@v5
|
||||||
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
|
if: ${{ ! startsWith(github.ref, 'refs/tags') }}
|
||||||
uses: geekyeggo/delete-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.package }}
|
name: ${{ inputs.package }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: 🗑️ Delete remaining Artifacts
|
- name: 🗑️ Delete remaining Artifacts
|
||||||
|
uses: geekyeggo/delete-artifact@v5
|
||||||
if: ${{ inputs.remaining != '' }}
|
if: ${{ inputs.remaining != '' }}
|
||||||
uses: geekyeggo/delete-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.remaining }}
|
name: ${{ inputs.remaining }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
14
.github/workflows/BuildTheDocs.yml
vendored
14
.github/workflows/BuildTheDocs.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -34,11 +34,14 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
BuildTheDocs:
|
BuildTheDocs:
|
||||||
name: 📓 Run BuildTheDocs
|
name: 📓 Run BuildTheDocs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: '❗ Deprecation message'
|
||||||
|
run: printf "::warning title=%s::%s\n" "Deprecated" "'BuildTheDocs.yml' is not maintained anymore. Please switch to 'SphinxDocumentation.yml', 'LaTeXDocumentation.yml' and 'ExtractConfiguration.yml'."
|
||||||
|
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 🛳️ Build documentation
|
- name: 🛳️ Build documentation
|
||||||
uses: buildthedocs/btd@v0
|
uses: buildthedocs/btd@v0
|
||||||
@@ -46,11 +49,12 @@ jobs:
|
|||||||
skip-deploy: true
|
skip-deploy: true
|
||||||
|
|
||||||
- name: 📤 Upload 'documentation' artifacts
|
- name: 📤 Upload 'documentation' artifacts
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.artifact != ''
|
if: inputs.artifact != ''
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
path: doc/_build/html
|
working-directory: doc/_build/html
|
||||||
|
path: '*'
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: '📓 Publish site to GitHub Pages'
|
- name: '📓 Publish site to GitHub Pages'
|
||||||
|
|||||||
44
.github/workflows/CheckDocumentation.yml
vendored
44
.github/workflows/CheckDocumentation.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Patrick Lehmann #
|
# Patrick Lehmann #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -24,44 +24,60 @@ name: Check Documentation
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
directory:
|
directory:
|
||||||
description: 'Source code directory to check.'
|
description: 'Source code directory to check.'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
# fail_below:
|
fail_under:
|
||||||
# description: 'Minimum required documentation coverage level'
|
description: 'Minimum required documentation coverage level'
|
||||||
# required: false
|
required: false
|
||||||
# default: 75
|
default: 80
|
||||||
# type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
DocCoverage:
|
DocCoverage:
|
||||||
name: 👀 Check documentation coverage
|
name: 👀 Check documentation coverage
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 🐍 Setup Python 3.11
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: ${{ inputs.python_version }}
|
||||||
|
|
||||||
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --disable-pip-version-check -U docstr_coverage interrogate
|
python -m pip install --disable-pip-version-check -U docstr_coverage interrogate[png]
|
||||||
|
|
||||||
- name: Run 'interrogate' Documentation Coverage Check
|
- name: Run 'interrogate' Documentation Coverage Check
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
interrogate -c pyproject.toml
|
set +e
|
||||||
|
|
||||||
|
interrogate -c pyproject.toml --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }}
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "::error title=%s::%s\n" "interrogate" "Insufficient documentation quality (goal: ${{ inputs.fail_under }})"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run 'docstr_coverage' Documentation Coverage Check
|
- name: Run 'docstr_coverage' Documentation Coverage Check
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
docstr_coverage -v ${{ inputs.directory }}
|
set +e
|
||||||
|
|
||||||
|
docstr-coverage --fail-under=${{ inputs.fail_under }} ${{ inputs.directory }}
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "%s\n" "::error title=docstr-coverage::Insufficient documentation quality (goal: ${{ inputs.fail_under }})"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|||||||
422
.github/workflows/CompletePipeline.yml
vendored
Normal file
422
.github/workflows/CompletePipeline.yml
vendored
Normal file
@@ -0,0 +1,422 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# 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: string
|
||||||
|
codacy:
|
||||||
|
description: 'Publish merged coverage report to Codacy.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
dorny:
|
||||||
|
description: 'Publish merged unittest report via Dorny Test-Reporter.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
cleanup:
|
||||||
|
description: 'Cleanup artifacts afterwards.'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
type: string
|
||||||
|
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_TOKEN:
|
||||||
|
description: "Token for pushing coverage results to Codacy."
|
||||||
|
required: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Prepare:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@main
|
||||||
|
|
||||||
|
ConfigParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@main
|
||||||
|
with:
|
||||||
|
package_namespace: ${{ inputs.package_namespace }}
|
||||||
|
package_name: ${{ inputs.package_name }}
|
||||||
|
|
||||||
|
UnitTestingParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
|
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@main
|
||||||
|
# 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 }}
|
||||||
|
|
||||||
|
InstallParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
|
with:
|
||||||
|
package_namespace: ${{ inputs.package_namespace }}
|
||||||
|
package_name: ${{ inputs.package_name }}
|
||||||
|
python_version: ${{ inputs.unittest_python_version }}
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
UnitTesting:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@main
|
||||||
|
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@main
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
with:
|
||||||
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
|
directory: ${{ needs.ConfigParams.outputs.package_directory }}
|
||||||
|
|
||||||
|
Package:
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
Install:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/InstallPackage.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- InstallParams
|
||||||
|
- Package
|
||||||
|
with:
|
||||||
|
jobs: ${{ needs.InstallParams.outputs.python_jobs }}
|
||||||
|
wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
||||||
|
package_name: ${{ needs.ConfigParams.outputs.package_fullname }}
|
||||||
|
|
||||||
|
# AppTesting:
|
||||||
|
# uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@main
|
||||||
|
# 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@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
if: success() || failure()
|
||||||
|
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:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }}
|
||||||
|
|
||||||
|
PublishTestResults:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
if: success() || failure()
|
||||||
|
with:
|
||||||
|
testsuite-summary-name: ${{ needs.ConfigParams.outputs.package_fullname }}
|
||||||
|
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:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
# VerifyDocs:
|
||||||
|
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@main
|
||||||
|
# needs:
|
||||||
|
# - UnitTestingParams
|
||||||
|
# with:
|
||||||
|
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
|
|
||||||
|
Documentation:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- PublishTestResults
|
||||||
|
- PublishCoverageResults
|
||||||
|
# - VerifyDocs
|
||||||
|
if: success() || failure()
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- PublishCoverageResults
|
||||||
|
- PublishTestResults
|
||||||
|
if: ( success() || failure() ) && inputs.cleanup == 'true'
|
||||||
|
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@main
|
||||||
|
# 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@main
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- Prepare
|
||||||
|
- UnitTesting
|
||||||
|
- Install
|
||||||
|
# - AppTesting
|
||||||
|
# - StaticTypeCheck
|
||||||
|
- Package
|
||||||
|
- PublishToGitHubPages
|
||||||
|
if: needs.Prepare.outputs.is_release_commit && github.event_name != 'schedule'
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- Prepare
|
||||||
|
- UnitTesting
|
||||||
|
- Install
|
||||||
|
# - 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@main
|
||||||
|
needs:
|
||||||
|
- Prepare
|
||||||
|
- UnitTestingParams
|
||||||
|
- Package
|
||||||
|
- 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:
|
||||||
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
|
||||||
|
ArtifactCleanUp:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
- StaticTypeCheck
|
||||||
|
- Documentation
|
||||||
|
# - PDFDocumentation
|
||||||
|
- PublishTestResults
|
||||||
|
- PublishCoverageResults
|
||||||
|
- PublishToGitHubPages
|
||||||
|
# - PublishOnPyPI
|
||||||
|
- IntermediateCleanUp
|
||||||
|
if: inputs.cleanup == 'true'
|
||||||
|
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 }}
|
||||||
32
.github/workflows/CoverageCollection.yml
vendored
32
.github/workflows/CoverageCollection.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,6 +25,11 @@ name: Coverage Collection
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
@@ -63,11 +68,17 @@ jobs:
|
|||||||
|
|
||||||
Coverage:
|
Coverage:
|
||||||
name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }}
|
name: 📈 Collect Coverage Data using Python ${{ inputs.python_version }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: '❗ Deprecation message'
|
||||||
|
run: printf "::warning title=%s::%s\n" "Deprecated" "'CoverageCollection.yml' is not maintained anymore. Please switch to 'UnitTesting.yml', 'PublishCoverageResults.yml' and 'PublishTestResults.yml'."
|
||||||
|
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -102,7 +113,9 @@ jobs:
|
|||||||
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
htmlDirectory = pyProjectSettings["tool"]["coverage"]["html"]["directory"]
|
||||||
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
xmlFile = pyProjectSettings["tool"]["coverage"]["xml"]["output"]
|
||||||
else:
|
else:
|
||||||
print(f"File '{pyProjectFile}' not found and no ' .coveragerc' file specified.")
|
print(f"File '{pyProjectFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{pyProjectFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
# Read output paths from '.coveragerc' file
|
||||||
elif len(coverageRC) > 0:
|
elif len(coverageRC) > 0:
|
||||||
@@ -115,6 +128,8 @@ jobs:
|
|||||||
xmlFile = coverageRCSettings["xml"]["output"]
|
xmlFile = coverageRCSettings["xml"]["output"]
|
||||||
else:
|
else:
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
print(f"File '{coverageRCFile}' not found.")
|
||||||
|
print(f"::error title=FileNotFoundError::File '{coverageRCFile}' not found.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# Write jobs to special file
|
# Write jobs to special file
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
github_output = Path(getenv("GITHUB_OUTPUT"))
|
||||||
@@ -135,7 +150,7 @@ jobs:
|
|||||||
ABSDIR=$(pwd)
|
ABSDIR=$(pwd)
|
||||||
cd "${{ inputs.tests_directory || '.' }}"
|
cd "${{ inputs.tests_directory || '.' }}"
|
||||||
[ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS
|
[ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS
|
||||||
echo "python -m pytest -rA --cov=${ABSDIR} ${PYCOV_ARGS} ${{ inputs.unittest_directory }} --color=yes"
|
printf "%s\n" "python -m pytest -rA --cov=${ABSDIR} ${PYCOV_ARGS} ${{ inputs.unittest_directory }} --color=yes"
|
||||||
python -m pytest -rA --cov=${ABSDIR} $PYCOV_ARGS ${{ inputs.unittest_directory }} --color=yes
|
python -m pytest -rA --cov=${ABSDIR} $PYCOV_ARGS ${{ inputs.unittest_directory }} --color=yes
|
||||||
|
|
||||||
- name: Convert to cobertura format
|
- name: Convert to cobertura format
|
||||||
@@ -148,16 +163,17 @@ jobs:
|
|||||||
|
|
||||||
- name: 📤 Upload 'Coverage Report' artifact
|
- name: 📤 Upload 'Coverage Report' artifact
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
working-directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📊 Publish coverage at CodeCov
|
- name: 📊 Publish coverage at CodeCov
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
files: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
files: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
||||||
flags: unittests
|
flags: unittests
|
||||||
|
|||||||
257
.github/workflows/ExtractConfiguration.yml
vendored
Normal file
257
.github/workflows/ExtractConfiguration.yml
vendored
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# 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: 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.13'
|
||||||
|
type: string
|
||||||
|
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
|
||||||
|
coverage_config:
|
||||||
|
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
||||||
|
required: false
|
||||||
|
default: 'pyproject.toml'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
package_fullname:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.package_fullname }}
|
||||||
|
package_directory:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.package_directory }}
|
||||||
|
mypy_prepare_command:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.mypy_prepare_command }}
|
||||||
|
unittest_report_xml_directory:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_report_xml_directory }}
|
||||||
|
unittest_report_xml_filename:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_report_xml_filename }}
|
||||||
|
unittest_report_xml:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_report_xml }}
|
||||||
|
unittest_merged_report_xml_directory:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml_directory }}
|
||||||
|
unittest_merged_report_xml_filename:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml_filename }}
|
||||||
|
unittest_merged_report_xml:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.unittest_merged_report_xml }}
|
||||||
|
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_filename:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.coverage_report_xml_filename }}
|
||||||
|
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_filename:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Extract.outputs.coverage_report_json_filename }}
|
||||||
|
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:
|
||||||
|
package_fullname: ${{ steps.getPackageName.outputs.package_fullname }}
|
||||||
|
package_directory: ${{ steps.getPackageName.outputs.package_directory }}
|
||||||
|
mypy_prepare_command: ${{ steps.getPackageName.outputs.mypy_prepare_command }}
|
||||||
|
unittest_report_xml_directory: ${{ steps.getVariables.outputs.unittest_report_xml_directory }}
|
||||||
|
unittest_report_xml_filename: ${{ steps.getVariables.outputs.unittest_report_xml_filename }}
|
||||||
|
unittest_report_xml: ${{ steps.getVariables.outputs.unittest_report_xml }}
|
||||||
|
unittest_merged_report_xml_directory: ${{ steps.getVariables.outputs.unittest_merged_report_xml_directory }}
|
||||||
|
unittest_merged_report_xml_filename: ${{ steps.getVariables.outputs.unittest_merged_report_xml_filename }}
|
||||||
|
unittest_merged_report_xml: ${{ steps.getVariables.outputs.unittest_merged_report_xml }}
|
||||||
|
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_filename: ${{ steps.getVariables.outputs.coverage_report_xml_filename }}
|
||||||
|
coverage_report_xml: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
||||||
|
coverage_report_json_directory: ${{ steps.getVariables.outputs.coverage_report_json_directory }}
|
||||||
|
coverage_report_json_filename: ${{ steps.getVariables.outputs.coverage_report_json_filename }}
|
||||||
|
coverage_report_json: ${{ steps.getVariables.outputs.coverage_report_json }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⏬ Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- 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: 🔁 Full package name and directory
|
||||||
|
id: getPackageName
|
||||||
|
shell: python
|
||||||
|
run: |
|
||||||
|
from os import getenv
|
||||||
|
from pathlib import Path
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
|
namespace = "${{ inputs.package_namespace }}".strip()
|
||||||
|
name = "${{ inputs.package_name }}".strip()
|
||||||
|
|
||||||
|
print(dedent(f"""\
|
||||||
|
INPUTS:
|
||||||
|
package_namespace: {namespace}
|
||||||
|
package_name: {name}
|
||||||
|
"""))
|
||||||
|
|
||||||
|
if namespace == "" or namespace == ".":
|
||||||
|
fullname = f"{name}"
|
||||||
|
directory = f"{name}"
|
||||||
|
mypy_prepare_command = ""
|
||||||
|
else:
|
||||||
|
fullname = f"{namespace}.{name}"
|
||||||
|
directory = f"{namespace}/{name}"
|
||||||
|
mypy_prepare_command = f"touch {namespace}/__init__.py"
|
||||||
|
|
||||||
|
print(dedent(f"""\
|
||||||
|
OUTPUTS:
|
||||||
|
package_fullname: {fullname}
|
||||||
|
package_directory: {directory}
|
||||||
|
mypy_prepare_command: {mypy_prepare_command}
|
||||||
|
"""))
|
||||||
|
|
||||||
|
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"""\
|
||||||
|
package_fullname={fullname}
|
||||||
|
package_directory={directory}
|
||||||
|
mypy_prepare_command={mypy_prepare_command}
|
||||||
|
"""))
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
unittestXMLFile = Path("./unittest.xml")
|
||||||
|
coverageHTMLDirectory = Path("htmlcov")
|
||||||
|
coverageXMLFile = Path("./coverage.xml")
|
||||||
|
coverageJSONFile = 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)
|
||||||
|
|
||||||
|
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"])
|
||||||
|
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)
|
||||||
|
|
||||||
|
coverageHTMLDirectory = Path(coverageRCSettings["html"]["directory"])
|
||||||
|
coverageXMLFile = Path(coverageRCSettings["xml"]["output"])
|
||||||
|
coverageJSONFile = 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"""\
|
||||||
|
unittest_report_xml_directory={unittestXMLFile.parent.as_posix()}
|
||||||
|
unittest_report_xml_filename={unittestXMLFile.name}
|
||||||
|
unittest_report_xml={unittestXMLFile.as_posix()}
|
||||||
|
unittest_merged_report_xml_directory={mergedUnittestXMLFile.parent.as_posix()}
|
||||||
|
unittest_merged_report_xml_filename={mergedUnittestXMLFile.name}
|
||||||
|
unittest_merged_report_xml={mergedUnittestXMLFile.as_posix()}
|
||||||
|
coverage_report_html_directory={coverageHTMLDirectory.as_posix()}
|
||||||
|
coverage_report_xml_directory={coverageXMLFile.parent.as_posix()}
|
||||||
|
coverage_report_xml_filename={coverageXMLFile.name}
|
||||||
|
coverage_report_xml={coverageXMLFile.as_posix()}
|
||||||
|
coverage_report_json_directory={coverageJSONFile.parent.as_posix()}
|
||||||
|
coverage_report_json_filename={coverageJSONFile.name}
|
||||||
|
coverage_report_json={coverageJSONFile.as_posix()}
|
||||||
|
"""))
|
||||||
|
|
||||||
|
print(dedent(f"""\
|
||||||
|
DEBUG:
|
||||||
|
unittest xml: {unittestXMLFile}
|
||||||
|
merged unittest xml: {mergedUnittestXMLFile}
|
||||||
|
coverage html: {coverageHTMLDirectory}
|
||||||
|
coverage xml: {coverageXMLFile}
|
||||||
|
coverage json: {coverageJSONFile}
|
||||||
|
"""))
|
||||||
130
.github/workflows/InstallPackage.yml
vendored
Normal file
130
.github/workflows/InstallPackage.yml
vendored
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# Authors: #
|
||||||
|
# Patrick Lehmann #
|
||||||
|
# #
|
||||||
|
# ==================================================================================================================== #
|
||||||
|
# Copyright 2025-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: Install Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
jobs:
|
||||||
|
description: 'JSON list with environment fields, telling the system and Python versions to run tests with.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
wheel:
|
||||||
|
description: "Wheel package as input artifact."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
package_name:
|
||||||
|
description: "Name of the Python package."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
PackageInstallation:
|
||||||
|
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Package installation using Python ${{ matrix.python }}
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJson(inputs.jobs) }}
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: ${{ matrix.shell }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 📥 Download artifacts '${{ inputs.wheel }}' from 'Package' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.wheel }}
|
||||||
|
path: install
|
||||||
|
|
||||||
|
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
if: matrix.system == 'msys2'
|
||||||
|
with:
|
||||||
|
msystem: ${{ matrix.runtime }}
|
||||||
|
update: true
|
||||||
|
pacboy: >-
|
||||||
|
python-pip:p python-wheel:p
|
||||||
|
python-lxml:p
|
||||||
|
python-markupsafe:p
|
||||||
|
python-pyaml:p python-types-pyyaml:p
|
||||||
|
python-ruamel-yaml:p python-ruamel.yaml.clib:p
|
||||||
|
python-tomli:p
|
||||||
|
|
||||||
|
- name: 🐍 Setup Python ${{ matrix.python }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
if: matrix.system != 'msys2'
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: 🔧 Install wheel and pip dependencies (native)
|
||||||
|
if: matrix.system != 'msys2'
|
||||||
|
run: |
|
||||||
|
python -m pip install --disable-pip-version-check -U wheel
|
||||||
|
|
||||||
|
- name: 🔧 Install wheel from artifact (Ubuntu/macOS)
|
||||||
|
if: matrix.system != 'windows'
|
||||||
|
run: |
|
||||||
|
python -m pip install --disable-pip-version-check -U install/*.whl
|
||||||
|
|
||||||
|
- name: 🔧 Install wheel from artifact (Windows)
|
||||||
|
if: matrix.system == 'windows'
|
||||||
|
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'
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
printf "Import package and checking package version ...\n "
|
||||||
|
python3 - << EOF | tee ImportTest.log | grep -E "^Package version:\s+[0-9]+\.[0-9]+\.[0-9]+"
|
||||||
|
from ${{ inputs.package_name }} import __version__
|
||||||
|
|
||||||
|
print(f"Package version: {__version__}")
|
||||||
|
EOF
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf " ${ANSI_LIGHT_GREEN}[PASSED]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf " ${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "::error title=%s::%s\n" "InstallPackage" "Couldn't check package version of '${{ inputs.package_name }}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📦 Run application tests (Windows)
|
||||||
|
if: matrix.system == 'windows'
|
||||||
|
run: |
|
||||||
|
$result=$(python -c "from ${{ inputs.package_name }} import __version__; print(f""Package version: {__version__}"")")
|
||||||
|
Write-Host $result
|
||||||
|
if ($result -match "Package version:\s+\d+\.\d+\.\d+") {
|
||||||
|
Write-Host -ForegroundColor Green "[PASSED]"
|
||||||
|
} else {
|
||||||
|
Write-Host -ForegroundColor Red "[FAILED]"
|
||||||
|
Write-Host ("::error title={0}::{1}" -f "InstallPackage", "Couldn't check package version of '${{ inputs.package_name }}'.")
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
17
.github/workflows/IntermediateCleanUp.yml
vendored
17
.github/workflows/IntermediateCleanUp.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Patrick Lehmann #
|
# Patrick Lehmann #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -24,6 +24,11 @@ name: Intermediate Cleanup
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
sqlite_coverage_artifacts_prefix:
|
sqlite_coverage_artifacts_prefix:
|
||||||
description: 'Prefix for SQLite coverage artifacts'
|
description: 'Prefix for SQLite coverage artifacts'
|
||||||
required: false
|
required: false
|
||||||
@@ -36,20 +41,18 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
IntermediateCleanUp:
|
IntermediateCleanUp:
|
||||||
name: 🗑️ Intermediate Artifact Cleanup
|
name: 🗑️ Intermediate Artifact Cleanup
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
steps:
|
steps:
|
||||||
- name: 🗑️ Delete SQLite coverage artifacts from matrix jobs
|
- name: 🗑️ Delete SQLite coverage artifacts from matrix jobs
|
||||||
uses: geekyeggo/delete-artifact@v4
|
uses: geekyeggo/delete-artifact@v5
|
||||||
if: inputs.sqlite_coverage_artifacts_prefix != ''
|
if: inputs.sqlite_coverage_artifacts_prefix != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.sqlite_coverage_artifacts_prefix }}*
|
name: ${{ inputs.sqlite_coverage_artifacts_prefix }}*
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: 🗑️ Delete XML coverage artifacts from matrix jobs
|
- name: 🗑️ Delete JUnit XML artifacts from matrix jobs
|
||||||
uses: geekyeggo/delete-artifact@v4
|
uses: geekyeggo/delete-artifact@v5
|
||||||
if: inputs.xml_unittest_artifacts_prefix != ''
|
if: inputs.xml_unittest_artifacts_prefix != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.xml_unittest_artifacts_prefix }}*
|
name: ${{ inputs.xml_unittest_artifacts_prefix }}*
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
32
.github/workflows/LaTeXDocumentation.yml
vendored
32
.github/workflows/LaTeXDocumentation.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Patrick Lehmann #
|
# Patrick Lehmann #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -24,6 +24,11 @@ name: LaTeX Documentation
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
document:
|
document:
|
||||||
description: 'LaTeX root document without *.tex extension.'
|
description: 'LaTeX root document without *.tex extension.'
|
||||||
required: true
|
required: true
|
||||||
@@ -42,25 +47,36 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
PDFDocumentation:
|
PDFDocumentation:
|
||||||
name: 📓 Converting LaTeX Documentation to PDF
|
name: 📓 Converting LaTeX Documentation to PDF
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
steps:
|
steps:
|
||||||
- name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job
|
- name: 📥 Download artifacts '${{ inputs.latex_artifact }}' from 'SphinxDocumentation' job
|
||||||
uses: actions/download-artifact@v4
|
uses: pyTooling/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.latex_artifact }}
|
name: ${{ inputs.latex_artifact }}
|
||||||
path: latex
|
path: latex
|
||||||
|
|
||||||
- name: Compile LaTeX document
|
- name: Debug
|
||||||
uses: xu-cheng/latex-action@master
|
run: |
|
||||||
|
tree -pash .
|
||||||
|
|
||||||
|
- name: Build LaTeX document using 'pytooling/miktex:sphinx'
|
||||||
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
working_directory: latex
|
image: pytooling/miktex:sphinx
|
||||||
root_file: ${{ inputs.document }}.tex
|
options: -v ${{ github.workspace }}/latex:/latex --workdir /latex
|
||||||
|
run: |
|
||||||
|
which pdflatex
|
||||||
|
pwd
|
||||||
|
ls -lAh
|
||||||
|
|
||||||
|
latexmk -xelatex ${{ inputs.document }}.tex
|
||||||
|
|
||||||
- name: 📤 Upload 'PDF Documentation' artifact
|
- name: 📤 Upload 'PDF Documentation' artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.pdf_artifact != ''
|
if: inputs.pdf_artifact != ''
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.pdf_artifact }}
|
name: ${{ inputs.pdf_artifact }}
|
||||||
|
working-directory: latex
|
||||||
path: ${{ inputs.document }}.pdf
|
path: ${{ inputs.document }}.pdf
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
530
.github/workflows/NightlyRelease.yml
vendored
Normal file
530
.github/workflows/NightlyRelease.yml
vendored
Normal file
@@ -0,0 +1,530 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# 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: Nightly
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ubuntu_image:
|
||||||
|
description: 'Name of the Ubuntu image.'
|
||||||
|
required: false
|
||||||
|
default: 'ubuntu-24.04'
|
||||||
|
type: string
|
||||||
|
nightly_name:
|
||||||
|
description: 'Name of the nightly release.'
|
||||||
|
required: false
|
||||||
|
default: 'nightly'
|
||||||
|
type: string
|
||||||
|
nightly_title:
|
||||||
|
description: 'Title of the nightly release.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
nightly_description:
|
||||||
|
description: 'Description of the nightly release.'
|
||||||
|
required: false
|
||||||
|
default: 'Release of artifacts from latest CI pipeline.'
|
||||||
|
type: string
|
||||||
|
draft:
|
||||||
|
description: 'Specify if this is a draft.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
prerelease:
|
||||||
|
description: 'Specify if this is a pre-release.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
latest:
|
||||||
|
description: 'Specify if this is the latest release.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
replacements:
|
||||||
|
description: 'Multi-line string containing search=replace patterns.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
assets:
|
||||||
|
description: 'Multi-line string containing artifact:file:title asset descriptions.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
inventory-json:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
inventory-version:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
inventory-categories:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
tarball-name:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: '__pyTooling_upload_artifact__.tar'
|
||||||
|
can-fail:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Release:
|
||||||
|
name: 📝 Update 'Nightly Page' on GitHub
|
||||||
|
runs-on: ${{ inputs.ubuntu_image }}
|
||||||
|
continue-on-error: ${{ inputs.can-fail }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
actions: write
|
||||||
|
# attestations: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⏬ Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
# The command 'git describe' (used for version) needs the history.
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 🔧 Install zstd
|
||||||
|
run: sudo apt-get install -y --no-install-recommends zstd
|
||||||
|
|
||||||
|
- name: 📑 Delete (old) Release Page
|
||||||
|
id: deleteReleasePage
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
printf "%s" "Deleting release '${{ inputs.nightly_name }}' ... "
|
||||||
|
message="$(gh release delete ${{ inputs.nightly_name }} --yes 2>&1)"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
elif [[ "${message}" == "release not found" ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_YELLOW}[NOT FOUND]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Couldn't delete release '${{ inputs.nightly_name }}' -> Error: '${message}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📑 (Re)create (new) Release Page
|
||||||
|
id: createReleasePage
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
addDraft="--draft"
|
||||||
|
|
||||||
|
if [[ "${{ inputs.prerelease }}" == "true" ]]; then
|
||||||
|
addPreRelease="--prerelease"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.latest }}" == "false" ]]; then
|
||||||
|
addLatest="--latest=false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.nightly_title }}" != "" ]]; then
|
||||||
|
addTitle=("--title" "${{ inputs.nightly_title }}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<'EOF' > __NoTeS__.md
|
||||||
|
${{ inputs.nightly_description }}
|
||||||
|
EOF
|
||||||
|
if [[ -s __NoTeS__.md ]]; then
|
||||||
|
addNotes=("--notes-file" "__NoTeS__.md")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply replacements
|
||||||
|
while IFS=$'\r\n' read -r patternLine; do
|
||||||
|
# skip empty lines
|
||||||
|
[[ "$patternLine" == "" ]] && continue
|
||||||
|
|
||||||
|
pattern="${patternLine%%=*}"
|
||||||
|
replacement="${patternLine#*=}"
|
||||||
|
sed -i -e "s/%$pattern%/$replacement/g" "__NoTeS__.md"
|
||||||
|
done <<<'${{ inputs.replacements }}'
|
||||||
|
|
||||||
|
# Add footer line
|
||||||
|
cat <<EOF >> __NoTeS__.md
|
||||||
|
|
||||||
|
--------
|
||||||
|
Published from [${{ github.workflow }}](https://github.com/Paebbels/ghdl/actions/runs/${{ github.run_id }}) workflow triggered by @${{ github.actor }} on $(date '+%Y-%m-%d %H:%M:%S %Z').
|
||||||
|
EOF
|
||||||
|
|
||||||
|
printf "%s\n" "Creating release '${{ inputs.nightly_name }}' ... "
|
||||||
|
message="$(gh release create "${{ inputs.nightly_name }}" --verify-tag $addDraft $addPreRelease $addLatest "${addTitle[@]}" "${addNotes[@]}" 2>&1)"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Couldn't create release '${{ inputs.nightly_name }}' -> Error: '${message}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📥 Download artifacts and upload as assets
|
||||||
|
id: uploadAssets
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
Replace() {
|
||||||
|
line="$1"
|
||||||
|
while IFS=$'\r\n' read -r patternLine; do
|
||||||
|
# skip empty lines
|
||||||
|
[[ "$patternLine" == "" ]] && continue
|
||||||
|
|
||||||
|
pattern="${patternLine%%=*}"
|
||||||
|
replacement="${patternLine#*=}"
|
||||||
|
line="${line//"%$pattern%"/"$replacement"}"
|
||||||
|
done <<<'${{ inputs.replacements }}'
|
||||||
|
printf "%s\n" "$line"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create JSON inventory
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
VERSION="1.0"
|
||||||
|
|
||||||
|
# Split categories by ',' into a Bash array.
|
||||||
|
# See https://stackoverflow.com/a/45201229/3719459
|
||||||
|
if [[ "${{ inputs.inventory-categories }}" != "" ]]; then
|
||||||
|
readarray -td, inventoryCategories <<<"${{ inputs.inventory-categories }},"
|
||||||
|
unset 'inventoryCategories[-1]'
|
||||||
|
declare -p inventoryCategories
|
||||||
|
else
|
||||||
|
inventoryCategories=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
jsonInventory=$(jq -c -n \
|
||||||
|
--arg version "${VERSION}" \
|
||||||
|
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
|
||||||
|
--argjson jsonMeta "$(jq -c -n \
|
||||||
|
--arg tag "${{ inputs.nightly_name }}" \
|
||||||
|
--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.nightly_name }}" \
|
||||||
|
--argjson categories "$(jq -c -n \
|
||||||
|
'$ARGS.positional' \
|
||||||
|
--args "${inventoryCategories[@]}" \
|
||||||
|
)" \
|
||||||
|
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories}' \
|
||||||
|
)" \
|
||||||
|
'{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
ERRORS=0
|
||||||
|
# A dictionary of 0/1 to avoid duplicate downloads
|
||||||
|
declare -A downloadedArtifacts
|
||||||
|
# A dictionary to check for duplicate asset files in release
|
||||||
|
declare -A assetFilenames
|
||||||
|
while IFS=$'\r\n' read -r assetLine; do
|
||||||
|
if [[ "${assetLine}" == "" || "${assetLine:0:1}" == "#" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# split assetLine colon separated triple: artifact:asset:title
|
||||||
|
artifact="${assetLine%%:*}"
|
||||||
|
assetLine="${assetLine#*:}"
|
||||||
|
asset="${assetLine%%:*}"
|
||||||
|
assetLine="${assetLine#*:}"
|
||||||
|
if [[ "${{ inputs.inventory-json }}" == "" ]]; then
|
||||||
|
categories=""
|
||||||
|
title="${assetLine##*:}"
|
||||||
|
else
|
||||||
|
categories="${assetLine%%:*}"
|
||||||
|
title="${assetLine##*:}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove leading whitespace
|
||||||
|
asset="${asset#"${asset%%[![:space:]]*}"}"
|
||||||
|
categories="${categories#"${categories%%[![:space:]]*}"}"
|
||||||
|
title="${title#"${title%%[![:space:]]*}"}"
|
||||||
|
|
||||||
|
# apply replacements
|
||||||
|
asset="$(Replace "${asset}")"
|
||||||
|
title="$(Replace "${title}")"
|
||||||
|
|
||||||
|
printf "%s\n" "Publish asset '${asset}' from artifact '${artifact}' with title '${title}'"
|
||||||
|
printf " %s" "Checked asset for duplicates ... "
|
||||||
|
if [[ -n "${assetFilenames[$asset]}" ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "DuplicateAsset" "Asset '${asset}' from artifact '${artifact}' was already uploaded to release '${{ inputs.nightly_name }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
assetFilenames[$asset]=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download artifact by artifact name
|
||||||
|
if [[ -n "${downloadedArtifacts[$artifact]}" ]]; then
|
||||||
|
printf " %s\n" "downloading '${artifact}' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
echo " downloading '${artifact}' ... "
|
||||||
|
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
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't download artifact '${artifact}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "ArtifactNotFound" "Couldn't download artifact '${artifact}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
downloadedArtifacts[$artifact]=1
|
||||||
|
|
||||||
|
printf " %s" "Checking for embedded tarball ... "
|
||||||
|
if [[ -f "${artifact}/${{ inputs.tarball-name }}" ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[FOUND]${ANSI_NOCOLOR}"
|
||||||
|
|
||||||
|
pushd "${artifact}" > /dev/null
|
||||||
|
|
||||||
|
printf " %s" "Extracting embedded tarball ... "
|
||||||
|
tar -xf "${{ inputs.tarball-name }}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf " %s" "Removing temporary tarball ... "
|
||||||
|
rm -f "${{ inputs.tarball-name }}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if artifact should be compressed (zip, tgz) or if asset was part of the downloaded artifact.
|
||||||
|
printf " %s" "checking asset '${artifact}/${asset}' ... "
|
||||||
|
if [[ "${asset}" == !*.zip ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[ZIP]${ANSI_NOCOLOR}"
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf "::group:: %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
zip -r "../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zip file '${asset}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to zip file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ "${asset}" == !*.tgz || "${asset}" == !*.tar.gz || "${asset}" == \$*.tgz || "${asset}" == \$*.tar.gz ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[TAR/GZ]${ANSI_NOCOLOR}"
|
||||||
|
|
||||||
|
if [[ "${asset:0:1}" == "\$" ]]; then
|
||||||
|
asset="${asset##*$}"
|
||||||
|
dirName="${asset%.*}"
|
||||||
|
printf " %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
tar -c --gzip --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" .
|
||||||
|
retCode=$?
|
||||||
|
else
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf " %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
tar -c --gzip --owner=0 --group=0 --file="../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to tgz file '${asset}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to tgz file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ "${asset}" == !*.tzst || "${asset}" == !*.tar.zst || "${asset}" == \$*.tzst || "${asset}" == \$*.tar.zst ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[ZST]${ANSI_NOCOLOR}"
|
||||||
|
|
||||||
|
if [[ "${asset:0:1}" == "\$" ]]; then
|
||||||
|
asset="${asset##*$}"
|
||||||
|
dirName="${asset%.*}"
|
||||||
|
printf " %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
tar -c --zstd --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" .
|
||||||
|
retCode=$?
|
||||||
|
else
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf " %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
tar -c --zstd --owner=0 --group=0 --file="../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " %s\n" "Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't compress '${artifact}' to zst file '${asset}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to zst file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ -e "${artifact}/${asset}" ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
uploadFile="${artifact}/${asset}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't find asset '${asset}' in artifact '${artifact}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "FileNotFound" "Couldn't find asset '${asset}' in artifact '${artifact}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add asset to JSON inventory
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
if [[ "${categories}" != "${title}" ]]; then
|
||||||
|
printf " %s\n" "adding file '${uploadFile#*/}' with '${categories//;/ → }' to JSON inventory ..."
|
||||||
|
category=""
|
||||||
|
jsonEntry=$(jq -c -n \
|
||||||
|
--arg title "${title}" \
|
||||||
|
--arg file "${uploadFile#*/}" \
|
||||||
|
'{"file": $file, "title": $title}' \
|
||||||
|
)
|
||||||
|
|
||||||
|
while [[ "${categories}" != "${category}" ]]; do
|
||||||
|
category="${categories##*,}"
|
||||||
|
categories="${categories%,*}"
|
||||||
|
jsonEntry=$(jq -c -n --arg cat "${category}" --argjson value "${jsonEntry}" '{$cat: $value}')
|
||||||
|
done
|
||||||
|
|
||||||
|
jsonInventory=$(jq -c -n \
|
||||||
|
--argjson inventory "${jsonInventory}" \
|
||||||
|
--argjson file "${jsonEntry}" \
|
||||||
|
'$inventory * {"files": $file}' \
|
||||||
|
)
|
||||||
|
else
|
||||||
|
printf " %s\n" "adding file '${uploadFile#*/}' to JSON inventory ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Upload asset to existing release page
|
||||||
|
printf " %s" "uploading asset '${asset}' from '${uploadFile}' with title '${title}' ... "
|
||||||
|
gh release upload ${{ inputs.nightly_name }} "${uploadFile}#${title}" --clobber
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "UploadError" "Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.nightly_name }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
done <<<'${{ inputs.assets }}'
|
||||||
|
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
inventoryTitle="Release Inventory (JSON)"
|
||||||
|
|
||||||
|
printf "%s\n" "Publish asset '${{ inputs.inventory-json }}' with title '${inventoryTitle}'"
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Writing JSON inventory to '${{ inputs.inventory-json }}' ...."
|
||||||
|
printf "%s\n" "$(jq -n --argjson inventory "${jsonInventory}" '$inventory')" > "${{ inputs.inventory-json }}"
|
||||||
|
cat "${{ inputs.inventory-json }}"
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
|
||||||
|
# Upload inventory asset to existing release page
|
||||||
|
printf " %s" "uploading asset '${{ inputs.inventory-json }}' title '${inventoryTitle}' ... "
|
||||||
|
gh release upload ${{ inputs.nightly_name }} "${{ inputs.inventory-json }}#${inventoryTitle}" --clobber
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't upload asset '${{ inputs.inventory-json }}' to release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "UploadError" "Couldn't upload asset '${{ inputs.inventory-json }}' to release '${{ inputs.nightly_name }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Inspecting downloaded artifacts ..."
|
||||||
|
tree -pash -L 3 .
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
|
||||||
|
if [[ $ERRORS -ne 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}${ERRORS} errors detected in previous steps.${ANSI_NOCOLOR}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📑 Remove draft state from Release Page
|
||||||
|
if: ${{ ! inputs.draft }}
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
# Remove draft-state from release page
|
||||||
|
printf "%s" "Remove draft-state from release '${title}' ... "
|
||||||
|
gh release edit --draft=false "${{ inputs.nightly_name }}"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}"
|
||||||
|
else
|
||||||
|
printf "%s\n" "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}"
|
||||||
|
printf " %s\n" "${ANSI_LIGHT_RED}Couldn't remove draft-state from release '${{ inputs.nightly_name }}'.${ANSI_NOCOLOR}"
|
||||||
|
printf "::error title=%s::%s\n" "ReleasePage" "Couldn't remove draft-state from release '${{ inputs.nightly_name }}'."
|
||||||
|
fi
|
||||||
21
.github/workflows/Package.yml
vendored
21
.github/workflows/Package.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,10 +25,15 @@ name: Package
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip; if empty, use pyproject.toml through build.'
|
description: 'Python dependencies to be installed through pip; if empty, use pyproject.toml through build.'
|
||||||
@@ -44,11 +49,14 @@ jobs:
|
|||||||
|
|
||||||
Package:
|
Package:
|
||||||
name: 📦 Package in Source and Wheel Format
|
name: 📦 Package in Source and Wheel Format
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -98,9 +106,10 @@ jobs:
|
|||||||
run: python setup.py bdist_wheel
|
run: python setup.py bdist_wheel
|
||||||
|
|
||||||
- name: 📤 Upload wheel artifact
|
- name: 📤 Upload wheel artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
path: dist/
|
working-directory: dist
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
160
.github/workflows/Parameters.yml
vendored
160
.github/workflows/Parameters.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,24 +25,40 @@ name: Parameters
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
description: 'Name of the tool.'
|
description: 'Name of the tool.'
|
||||||
required: true
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
package_namespace:
|
||||||
|
description: 'Name of the tool''s namespace.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
package_name:
|
||||||
|
description: 'Name of the tool''s package.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
python_version_list:
|
python_version_list:
|
||||||
description: 'Space separated list of Python versions to run tests with.'
|
description: 'Space separated list of Python versions to run tests with.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.8 3.9 3.10 3.11 3.12'
|
default: '3.9 3.10 3.11 3.12 3.13'
|
||||||
type: string
|
type: string
|
||||||
system_list:
|
system_list:
|
||||||
description: 'Space separated list of systems to run tests on.'
|
description: 'Space separated list of systems to run tests on.'
|
||||||
required: false
|
required: false
|
||||||
default: 'ubuntu windows macos mingw64 ucrt64'
|
default: 'ubuntu windows macos macos-arm mingw64 ucrt64'
|
||||||
type: string
|
type: string
|
||||||
include_list:
|
include_list:
|
||||||
description: 'Space separated list of system:python items to be included into the list of test.'
|
description: 'Space separated list of system:python items to be included into the list of test.'
|
||||||
@@ -59,6 +75,31 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
ubuntu_image:
|
||||||
|
description: 'The used GitHub Action image for Ubuntu based jobs.'
|
||||||
|
required: false
|
||||||
|
default: 'ubuntu-24.04'
|
||||||
|
type: string
|
||||||
|
windows_image:
|
||||||
|
description: 'The used GitHub Action image for Windows based jobs.'
|
||||||
|
required: false
|
||||||
|
default: 'windows-2022'
|
||||||
|
type: string
|
||||||
|
macos_intel_image:
|
||||||
|
description: 'The used GitHub Action image for macOS (Intel x86-64) based jobs.'
|
||||||
|
required: false
|
||||||
|
default: 'macos-13'
|
||||||
|
type: string
|
||||||
|
macos_arm_image:
|
||||||
|
description: 'The used GitHub Action image for macOS (ARM aarch64) based jobs.'
|
||||||
|
required: false
|
||||||
|
default: 'macos-14'
|
||||||
|
type: string
|
||||||
|
pipeline-delay:
|
||||||
|
description: 'Slow down this job, to delay the startup of the GitHub Action pipline.'
|
||||||
|
required: false
|
||||||
|
default: 0
|
||||||
|
type: number
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
python_version:
|
python_version:
|
||||||
@@ -76,7 +117,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Parameters:
|
Parameters:
|
||||||
runs-on: ubuntu-latest
|
name: ✎ Generate pipeline parameters
|
||||||
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
outputs:
|
outputs:
|
||||||
python_version: ${{ steps.params.outputs.python_version }}
|
python_version: ${{ steps.params.outputs.python_version }}
|
||||||
python_jobs: ${{ steps.params.outputs.python_jobs }}
|
python_jobs: ${{ steps.params.outputs.python_jobs }}
|
||||||
@@ -84,6 +126,12 @@ jobs:
|
|||||||
params: ${{ steps.params.outputs.params }}
|
params: ${{ steps.params.outputs.params }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Generate a startup delay of ${{ inputs.pipeline-delay }} seconds
|
||||||
|
id: delay
|
||||||
|
if: inputs.pipeline-delay >= 0
|
||||||
|
run: |
|
||||||
|
sleep ${{ inputs.pipeline-delay }}
|
||||||
|
|
||||||
- name: Generate 'params' and 'python_jobs'
|
- name: Generate 'params' and 'python_jobs'
|
||||||
id: params
|
id: params
|
||||||
shell: python
|
shell: python
|
||||||
@@ -91,10 +139,12 @@ jobs:
|
|||||||
from json import dumps as json_dumps
|
from json import dumps as json_dumps
|
||||||
from os import getenv
|
from os import getenv
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
from typing import Iterable
|
||||||
|
|
||||||
name = "${{ inputs.name }}".strip()
|
package_namespace = "${{ inputs.package_namespace }}".strip()
|
||||||
|
package_name = "${{ inputs.package_name }}".strip()
|
||||||
|
name = "${{ inputs.name }}".strip()
|
||||||
python_version = "${{ inputs.python_version }}".strip()
|
python_version = "${{ inputs.python_version }}".strip()
|
||||||
systems = "${{ inputs.system_list }}".strip()
|
systems = "${{ inputs.system_list }}".strip()
|
||||||
versions = "${{ inputs.python_version_list }}".strip()
|
versions = "${{ inputs.python_version_list }}".strip()
|
||||||
@@ -102,9 +152,15 @@ jobs:
|
|||||||
exclude_list = "${{ inputs.exclude_list }}".strip()
|
exclude_list = "${{ inputs.exclude_list }}".strip()
|
||||||
disable_list = "${{ inputs.disable_list }}".strip()
|
disable_list = "${{ inputs.disable_list }}".strip()
|
||||||
|
|
||||||
currentMSYS2Version = "3.11"
|
if name == "":
|
||||||
currentAlphaVersion = "3.13"
|
if package_namespace == "" or package_namespace == ".":
|
||||||
currentAlphaRelease = "3.13.0-alpha.1"
|
name = f"{package_name}"
|
||||||
|
else:
|
||||||
|
name = f"{package_namespace}.{package_name}"
|
||||||
|
|
||||||
|
currentMSYS2Version = "3.12"
|
||||||
|
currentAlphaVersion = "3.14"
|
||||||
|
currentAlphaRelease = "3.14.0-alpha.1"
|
||||||
|
|
||||||
if systems == "":
|
if systems == "":
|
||||||
print("::error title=Parameter::system_list is empty.")
|
print("::error title=Parameter::system_list is empty.")
|
||||||
@@ -131,35 +187,38 @@ jobs:
|
|||||||
else:
|
else:
|
||||||
disabled = [disable.strip() for disable in disable_list.split(" ")]
|
disabled = [disable.strip() for disable in disable_list.split(" ")]
|
||||||
|
|
||||||
if "3.7" in versions:
|
if "3.8" in versions:
|
||||||
print("::warning title=Deprecated::Support for Python 3.7 ended in 2023.06.27.")
|
print("::warning title=Deprecated::Support for Python 3.8 ended in 2024.10.")
|
||||||
if "msys2" in systems:
|
if "msys2" in systems:
|
||||||
print("::warning title=Deprecated::System 'msys2' will be replaced by 'mingw64'.")
|
print("::warning title=Deprecated::System 'msys2' will be replaced by 'mingw64'.")
|
||||||
if currentAlphaVersion in versions:
|
if currentAlphaVersion in versions:
|
||||||
print(f"::notice title=Experimental::Python {currentAlphaVersion} ({currentAlphaRelease}) is a pre-release.")
|
print(f"::notice title=Experimental::Python {currentAlphaVersion} ({currentAlphaRelease}) is a pre-release.")
|
||||||
for disable in disabled:
|
for disable in disabled:
|
||||||
print(f"::warning title=Disabled Python Job::System '{disable}' temporary disabled.")
|
print(f"::warning title=Disabled Python Job::System '{disable}' temporarily disabled.")
|
||||||
|
|
||||||
|
# see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
|
||||||
data = {
|
data = {
|
||||||
# Python and PyPy versions supported by "setup-python" action
|
# Python and PyPy versions supported by "setup-python" action
|
||||||
"python": {
|
"python": {
|
||||||
"3.7": { "icon": "⚫", "until": "2023.06.27" },
|
"3.8": { "icon": "⚫", "until": "2024.10" },
|
||||||
"3.8": { "icon": "🔴", "until": "2024.10" },
|
"3.9": { "icon": "🔴", "until": "2025.10" },
|
||||||
"3.9": { "icon": "🟠", "until": "2025.10" },
|
"3.10": { "icon": "🟠", "until": "2026.10" },
|
||||||
"3.10": { "icon": "🟡", "until": "2026.10" },
|
"3.11": { "icon": "🟡", "until": "2027.10" },
|
||||||
"3.11": { "icon": "🟢", "until": "2027.10" },
|
|
||||||
"3.12": { "icon": "🟢", "until": "2028.10" },
|
"3.12": { "icon": "🟢", "until": "2028.10" },
|
||||||
# "3.13": { "icon": "🟣", "until": "2028.10" },
|
"3.13": { "icon": "🟢", "until": "2029.10" },
|
||||||
|
"3.14": { "icon": "🟣", "until": "2030.10" },
|
||||||
"pypy-3.7": { "icon": "⟲⚫", "until": "????.??" },
|
"pypy-3.7": { "icon": "⟲⚫", "until": "????.??" },
|
||||||
"pypy-3.8": { "icon": "⟲🔴", "until": "????.??" },
|
"pypy-3.8": { "icon": "⟲⚫", "until": "????.??" },
|
||||||
"pypy-3.9": { "icon": "⟲🟠", "until": "????.??" },
|
"pypy-3.9": { "icon": "⟲🔴", "until": "????.??" },
|
||||||
"pypy-3.10": { "icon": "⟲🟡", "until": "????.??" },
|
"pypy-3.10": { "icon": "⟲🟠", "until": "????.??" },
|
||||||
|
"pypy-3.11": { "icon": "⟲🟡", "until": "????.??" },
|
||||||
},
|
},
|
||||||
# Runner systems (runner images) supported by GitHub Actions
|
# Runner systems (runner images) supported by GitHub Actions
|
||||||
"sys": {
|
"sys": {
|
||||||
"ubuntu": { "icon": "🐧", "runs-on": "ubuntu-latest", "shell": "bash", "name": "Linux (x86-64)" },
|
"ubuntu": { "icon": "🐧", "runs-on": "${{ inputs.ubuntu_image }}", "shell": "bash", "name": "Linux (x86-64)" },
|
||||||
"windows": { "icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)" },
|
"windows": { "icon": "🪟", "runs-on": "${{ inputs.windows_image }}", "shell": "pwsh", "name": "Windows (x86-64)" },
|
||||||
"macos": { "icon": "🍎", "runs-on": "macos-latest", "shell": "bash", "name": "MacOS (x86-64)" },
|
"macos": { "icon": "🍎", "runs-on": "${{ inputs.macos_intel_image }}", "shell": "bash", "name": "macOS (x86-64)" },
|
||||||
|
"macos-arm": { "icon": "🍏", "runs-on": "${{ inputs.macos_arm_image }}", "shell": "bash", "name": "macOS (aarch64)" },
|
||||||
},
|
},
|
||||||
# Runtimes provided by MSYS2
|
# Runtimes provided by MSYS2
|
||||||
"runtime": {
|
"runtime": {
|
||||||
@@ -182,26 +241,44 @@ jobs:
|
|||||||
for disable in disabled:
|
for disable in disabled:
|
||||||
print(f"- {disable}")
|
print(f"- {disable}")
|
||||||
|
|
||||||
|
def match(combination: str, pattern: str) -> bool:
|
||||||
|
system, version = combination.split(":")
|
||||||
|
sys, ver = pattern.split(":")
|
||||||
|
|
||||||
|
if sys == "*":
|
||||||
|
return (ver == "*") or (version == ver)
|
||||||
|
elif system == sys:
|
||||||
|
return (ver == "*") or (version == ver)
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def notIn(combination: str, patterns: Iterable[str]) -> bool:
|
||||||
|
for pattern in patterns:
|
||||||
|
if match(combination, pattern):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
combinations = [
|
combinations = [
|
||||||
(system, version)
|
(system, version)
|
||||||
for system in systems
|
for system in systems
|
||||||
if system in data["sys"]
|
if system in data["sys"]
|
||||||
for version in versions
|
for version in versions
|
||||||
if version in data["python"]
|
if version in data["python"]
|
||||||
and f"{system}:{version}" not in excludes
|
and notIn(f"{system}:{version}", excludes)
|
||||||
and f"{system}:{version}" not in disabled
|
and notIn(f"{system}:{version}", disabled)
|
||||||
] + [
|
] + [
|
||||||
(system, currentMSYS2Version)
|
(system, currentMSYS2Version)
|
||||||
for system in systems
|
for system in systems
|
||||||
if system in data["runtime"]
|
if system in data["runtime"]
|
||||||
and f"{system}:{currentMSYS2Version}" not in excludes
|
and notIn(f"{system}:{currentMSYS2Version}", excludes)
|
||||||
and f"{system}:{currentMSYS2Version}" not in disabled
|
and notIn(f"{system}:{currentMSYS2Version}", disabled)
|
||||||
] + [
|
] + [
|
||||||
(system, version)
|
(system, version)
|
||||||
for system, version in includes
|
for system, version in includes
|
||||||
if system in data["sys"]
|
if system in data["sys"]
|
||||||
and version in data["python"]
|
and version in data["python"]
|
||||||
and f"{system}:{version}" not in disabled
|
and notIn(f"{system}:{version}", disabled)
|
||||||
]
|
]
|
||||||
print(f"Combinations ({len(combinations)}):")
|
print(f"Combinations ({len(combinations)}):")
|
||||||
for system, version in combinations:
|
for system, version in combinations:
|
||||||
@@ -250,18 +327,6 @@ jobs:
|
|||||||
"documentation_pdf": f"{name}-Documentation-PDF",
|
"documentation_pdf": f"{name}-Documentation-PDF",
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deprecated structure
|
|
||||||
params = {
|
|
||||||
"python_version": python_version,
|
|
||||||
"artifacts": {
|
|
||||||
"unittesting": f"{artifact_names['unittesting_xml']}",
|
|
||||||
"coverage": f"{artifact_names['codecoverage_html']}",
|
|
||||||
"typing": f"{artifact_names['statictyping_html']}",
|
|
||||||
"package": f"{artifact_names['package_all']}",
|
|
||||||
"doc": f"{artifact_names['documentation_html']}",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print("Parameters:")
|
print("Parameters:")
|
||||||
print(f" python_version: {python_version}")
|
print(f" python_version: {python_version}")
|
||||||
print(f" python_jobs ({len(jobs)}):\n" +
|
print(f" python_jobs ({len(jobs)}):\n" +
|
||||||
@@ -279,13 +344,12 @@ jobs:
|
|||||||
python_version={python_version}
|
python_version={python_version}
|
||||||
python_jobs={json_dumps(jobs)}
|
python_jobs={json_dumps(jobs)}
|
||||||
artifact_names={json_dumps(artifact_names)}
|
artifact_names={json_dumps(artifact_names)}
|
||||||
params={json_dumps(params)}
|
|
||||||
"""))
|
"""))
|
||||||
|
|
||||||
- name: Verify out parameters
|
- name: Verify out parameters
|
||||||
id: verify
|
id: verify
|
||||||
run: |
|
run: |
|
||||||
echo 'python_version: ${{ steps.params.outputs.python_version }}'
|
printf "python_version: %s\n" '${{ steps.params.outputs.python_version }}'
|
||||||
echo 'python_jobs: ${{ steps.params.outputs.python_jobs }}'
|
printf "python_jobs: %s\n" '${{ steps.params.outputs.python_jobs }}'
|
||||||
echo 'artifact_names: ${{ steps.params.outputs.artifact_names }}'
|
printf "artifact_names: %s\n" '${{ steps.params.outputs.artifact_names }}'
|
||||||
echo 'params: ${{ steps.params.outputs.params }}'
|
printf "params: %s\n" '${{ steps.params.outputs.params }}'
|
||||||
|
|||||||
345
.github/workflows/PrepareJob.yml
vendored
Normal file
345
.github/workflows/PrepareJob.yml
vendored
Normal file
@@ -0,0 +1,345 @@
|
|||||||
|
name: Prepare Variables
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ubuntu_image:
|
||||||
|
description: 'Name of the Ubuntu image.'
|
||||||
|
required: false
|
||||||
|
default: 'ubuntu-24.04'
|
||||||
|
type: string
|
||||||
|
main_branch:
|
||||||
|
description: 'Name of the branch containing releases.'
|
||||||
|
required: false
|
||||||
|
default: 'main'
|
||||||
|
type: string
|
||||||
|
development_branch:
|
||||||
|
description: 'Name of the development branch containing features.'
|
||||||
|
required: false
|
||||||
|
default: 'dev'
|
||||||
|
type: string
|
||||||
|
release_branch:
|
||||||
|
description: 'Name of the branch containing releases and nightly builds.'
|
||||||
|
required: false
|
||||||
|
default: 'main'
|
||||||
|
type: string
|
||||||
|
nightly_tag_pattern:
|
||||||
|
description: 'Pattern for nightly tags on the release branch.'
|
||||||
|
required: false
|
||||||
|
default: 'nightly'
|
||||||
|
type: string
|
||||||
|
release_tag_pattern:
|
||||||
|
description: 'Pattern for release tags on the release branch. Usually: vXX.YY.ZZ'
|
||||||
|
required: false
|
||||||
|
default: '(v|r)?[0-9]+(\.[0-9]+){0,2}(-(dev|alpha|beta|rc)([0-9]*))?'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
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 }}
|
||||||
|
is_regular_commit:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.is_regular_commit }}
|
||||||
|
is_merge_commit:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.is_merge_commit }}
|
||||||
|
is_release_commit:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.is_release_commit }}
|
||||||
|
is_nightly_tag:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.is_nightly_tag }}
|
||||||
|
is_release_tag:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.is_release_tag }}
|
||||||
|
ref_kind:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.ref_kind }}
|
||||||
|
branch:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.branch }}
|
||||||
|
tag:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.tag }}
|
||||||
|
version:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.version }}
|
||||||
|
pr_title:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.pr_title }}
|
||||||
|
pr_number:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.pr_number }}
|
||||||
|
# pr_mergedby:
|
||||||
|
# description: ""
|
||||||
|
# value: ${{ jobs.Prepare.outputs.pr_mergedby }}
|
||||||
|
# pr_mergedat:
|
||||||
|
# description: ""
|
||||||
|
# value: ${{ jobs.Prepare.outputs.pr_mergedat }}
|
||||||
|
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⏬ Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
# The command 'git describe' (used for version) needs the history.
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 🖉 GitHub context information
|
||||||
|
run: |
|
||||||
|
printf "%s\n" "github.event_name: ${{ github.event_name }}"
|
||||||
|
printf "%s\n" "github.actor: ${{ github.actor }}"
|
||||||
|
printf "%s\n" "github.ref: ${{ github.ref }}"
|
||||||
|
printf "%s\n" "github.base_ref: ${{ github.base_ref }}"
|
||||||
|
printf "%s\n" "github.head_ref: ${{ github.head_ref }}"
|
||||||
|
printf "%s\n" "github.sha: ${{ github.sha }}"
|
||||||
|
|
||||||
|
- name: 🖉 Classify commit
|
||||||
|
id: Classify
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
ref="${{ github.ref }}"
|
||||||
|
on_main_branch="false"
|
||||||
|
on_dev_branch="false"
|
||||||
|
on_release_branch="false"
|
||||||
|
is_regular_commit="false"
|
||||||
|
is_merge_commit="false"
|
||||||
|
is_release_commit="false"
|
||||||
|
is_nightly_tag="false"
|
||||||
|
is_release_tag="false"
|
||||||
|
ref_kind="unknown"
|
||||||
|
branch=""
|
||||||
|
tag=""
|
||||||
|
pr_number=""
|
||||||
|
version=""
|
||||||
|
|
||||||
|
if [[ "${ref:0:11}" == "refs/heads/" ]]; then
|
||||||
|
ref_kind="branch"
|
||||||
|
branch="${ref:11}"
|
||||||
|
|
||||||
|
printf "Commit check:\n"
|
||||||
|
|
||||||
|
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 }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
||||||
|
on_release_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_release_commit="true"
|
||||||
|
printf " ${ANSI_LIGHT_GREEN}release "
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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 }}"
|
||||||
|
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 "${ANSI_LIGHT_GREEN}[NIGHTLY]${ANSI_NOCOLOR}\n"
|
||||||
|
is_nightly_tag="true"
|
||||||
|
elif [[ "${tag}" =~ $RELEASE_TAG_PATTERN ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[RELEASE]${ANSI_NOCOLOR}\n"
|
||||||
|
version="${tag}"
|
||||||
|
is_release_tag="true"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "${ANSI_LIGHT_RED}Tag name '%s' doesn't conform to regexp${ANSI_NOCOLOR}\n" "${tag}"
|
||||||
|
printf " ${ANSI_LIGHT_RED}nightly tag: %s${ANSI_NOCOLOR}\n" "${NIGHTLY_TAG_PATTERN}"
|
||||||
|
printf " ${ANSI_LIGHT_RED}release tag: %s${ANSI_NOCOLOR}\n" "${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
|
||||||
|
fi
|
||||||
|
elif [[ "${ref:0:10}" == "refs/pull/" ]]; then
|
||||||
|
ref_kind="pullrequest"
|
||||||
|
pr_number=${ref:11}
|
||||||
|
pr_number=${pr_number%%/*}
|
||||||
|
|
||||||
|
printf "Pull Request check:\n"
|
||||||
|
printf " Number: %s\n" "${pr_number}"
|
||||||
|
else
|
||||||
|
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
|
||||||
|
|
||||||
|
tee --append "${GITHUB_OUTPUT}" <<EOF
|
||||||
|
on_main_branch=${on_main_branch}
|
||||||
|
on_dev_branch=${on_dev_branch}
|
||||||
|
on_release_branch=${on_release_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}
|
||||||
|
ref_kind=${ref_kind}
|
||||||
|
branch=${branch}
|
||||||
|
tag=${tag}
|
||||||
|
pr_number=${pr_number}
|
||||||
|
version=${version}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: 🔁 Find merged PullRequest from second parent of current SHA (${{ github.sha }})
|
||||||
|
id: FindPullRequest
|
||||||
|
if: steps.Classify.outputs.is_merge_commit == 'true'
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
printf "Read second parent of current SHA (%s) ... " "${{ github.ref }}"
|
||||||
|
FATHER_SHA=$(git rev-parse ${{ github.ref }}^2)
|
||||||
|
if [[ $? -ne 0 || "{FATHER_SHA}" == "" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "${ANSI_LIGHT_RED}Couldn't read second parent (father) of '%s'.${ANSI_NOCOLOR}\n" "${{ github.ref }}^2"
|
||||||
|
printf "::error title=GitCommitHistoryError::Couldn't read second parent (father) of '%s'. -> %s\n" "${{ github.ref }}^2" "${FATHER_SHA}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "Search Pull Request to '%s' and branch containing SHA %s ... " "${{ inputs.release_branch }}" "${FATHER_SHA}"
|
||||||
|
PULL_REQUESTS=$(gh pr list --base "${{ inputs.release_branch }}" --search "${FATHER_SHA}" --state "merged" --json "title,number,mergedBy,mergedAt")
|
||||||
|
if [[ $? -ne 0 || "${PULL_REQUESTS}" == "" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "${ANSI_LIGHT_RED}Couldn't find a merged Pull Request to '%s'. -> %s${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}" "${PULL_REQUESTS}"
|
||||||
|
printf "::error title=PullRequest::Couldn't find a merged Pull Request to '%s'. -> %s\n" "${{ inputs.release_branch }}" "${PULL_REQUESTS}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
PR_TITLE="$( printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].title")"
|
||||||
|
PR_NUMBER="$( printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].number")"
|
||||||
|
PR_MERGED_BY="$(printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].mergedBy.login")"
|
||||||
|
PR_MERGED_AT="$(printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].mergedAt")"
|
||||||
|
|
||||||
|
printf "${ANSI_LIGHT_BLUE}Found Pull Request:${ANSI_NOCOLOR}\n"
|
||||||
|
printf " %s\n" "Title: ${PR_TITLE}"
|
||||||
|
printf " %s\n" "Number: ${PR_NUMBER}"
|
||||||
|
printf " %s\n" "MergedBy: ${PR_MERGED_BY}"
|
||||||
|
printf " %s\n" "MergedAt: ${PR_MERGED_AT} ($(date -d"${PR_MERGED_AT}" '+%d.%m.%Y - %H:%M:%S'))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE_TAG_PATTERN='^${{ inputs.release_tag_pattern }}$'
|
||||||
|
printf "Check Pull Request title against regexp '%s' ... " "${RELEASE_TAG_PATTERN}"
|
||||||
|
if [[ "${PR_TITLE}" =~ $RELEASE_TAG_PATTERN ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
RELEASE_VERSION="${PR_TITLE}"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "${ANSI_LIGHT_RED}Pull Request title '%s' doesn't conform to regexp '%s'.${ANSI_NOCOLOR}\n" "${PR_TITLE}" "${RELEASE_TAG_PATTERN}"
|
||||||
|
printf "::error title=RexExpCheck::Pull Request title '%s' doesn't conform to regexp '%s'.\n" "${PR_TITLE}" "${RELEASE_TAG_PATTERN}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "Release tag: ${ANSI_LIGHT_GREEN}%s${ANSI_NOCOLOR}\n" "${RELEASE_VERSION}"
|
||||||
|
tee --append "${GITHUB_OUTPUT}" <<EOF
|
||||||
|
pr_version=${RELEASE_VERSION}
|
||||||
|
pr_title=${PR_TITLE}
|
||||||
|
pr_number=${PR_NUMBER}
|
||||||
|
pr_mergedby=${PR_MERGED_BY}
|
||||||
|
pr_mergedat=${PR_MERGED_AT}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- 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 }}"
|
||||||
190
.github/workflows/PublishCoverageResults.yml
vendored
190
.github/workflows/PublishCoverageResults.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Patrick Lehmann #
|
# Patrick Lehmann #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -24,6 +24,15 @@ name: Publish Code Coverage Results
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
|
coverage_artifacts_pattern:
|
||||||
|
required: false
|
||||||
|
default: '*-CodeCoverage-SQLite-*'
|
||||||
|
type: string
|
||||||
coverage_config:
|
coverage_config:
|
||||||
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
||||||
required: false
|
required: false
|
||||||
@@ -39,101 +48,91 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
coverage_report_xml_directory:
|
||||||
|
description: 'Directory containing the XML coverage report file.'
|
||||||
|
required: false
|
||||||
|
default: 'report/coverage'
|
||||||
|
type: string
|
||||||
|
coverage_report_xml_filename:
|
||||||
|
description: 'Filename of the XML coverage report file.'
|
||||||
|
required: false
|
||||||
|
default: 'coverage.xml'
|
||||||
|
type: string
|
||||||
coverage_json_artifact:
|
coverage_json_artifact:
|
||||||
description: 'Name of the JSON coverage artifact.'
|
description: 'Name of the JSON coverage artifact.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
coverage_report_json_directory:
|
||||||
|
description: 'Directory containing the JSON coverage report file.'
|
||||||
|
required: false
|
||||||
|
default: 'report/coverage'
|
||||||
|
type: string
|
||||||
|
coverage_report_json_filename:
|
||||||
|
description: 'Filename of the JSON coverage report file.'
|
||||||
|
required: false
|
||||||
|
default: 'coverage.json'
|
||||||
|
type: string
|
||||||
coverage_html_artifact:
|
coverage_html_artifact:
|
||||||
description: 'Name of the HTML coverage artifact.'
|
description: 'Name of the HTML coverage artifact.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
coverage_report_html_directory:
|
||||||
|
description: 'HTML root directory of the generated coverage report.'
|
||||||
|
required: false
|
||||||
|
default: 'report/coverage/html'
|
||||||
|
type: string
|
||||||
|
codecov:
|
||||||
|
description: 'Publish merged coverage report to Codecov.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
codacy:
|
||||||
|
description: 'Publish merged coverage report to Codacy.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
codacy_token:
|
CODECOV_TOKEN:
|
||||||
description: 'Token to push result to codacy.'
|
description: 'Token to push result to Codecov.'
|
||||||
required: true
|
required: false
|
||||||
|
CODACY_TOKEN:
|
||||||
|
description: 'Token to push result to Codacy.'
|
||||||
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
PublishCoverageResults:
|
PublishCoverageResults:
|
||||||
name: 📊 Publish Code Coverage Results
|
name: 📊 Publish Code Coverage Results
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Download Artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: 📥 Download Artifacts
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
|
with:
|
||||||
|
pattern: ${{ inputs.coverage_artifacts_pattern }}
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
|
- name: 🔎 Inspect extracted artifact (tarball)
|
||||||
|
run: |
|
||||||
|
tree -pash artifacts
|
||||||
|
|
||||||
- name: 🔧 Install coverage and tomli
|
- name: 🔧 Install coverage and tomli
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --disable-pip-version-check -U coverage[toml] tomli
|
python -m pip install -U --disable-pip-version-check --break-system-packages coverage[toml] tomli
|
||||||
|
|
||||||
- name: 🔁 Extract configurations from pyproject.toml
|
- name: Rename .coverage files and move them all into 'coverage/'
|
||||||
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 and no '.coveragerc' file specified.")
|
|
||||||
|
|
||||||
# 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.")
|
|
||||||
|
|
||||||
# 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={xmlFile}
|
|
||||||
coverage_report_json={jsonFile}
|
|
||||||
"""))
|
|
||||||
|
|
||||||
print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}")
|
|
||||||
|
|
||||||
- name: Rename .coverage files and collect them all to coverage/
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p coverage
|
mkdir -p coverage
|
||||||
find . -type f -path "*artifacts*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';'
|
find artifacts/ -type f -path "*SQLite*.coverage" -exec sh -c 'cp -v $0 "coverage/$(basename $0).$(basename $(dirname $0))"' {} ';'
|
||||||
tree -a coverage
|
tree -pash coverage
|
||||||
|
|
||||||
- name: Combine SQLite files (using Coverage.py)
|
- name: Combine SQLite files (using Coverage.py)
|
||||||
run: coverage combine --data-file=.coverage coverage/
|
run: coverage combine --data-file=.coverage coverage/
|
||||||
@@ -142,7 +141,7 @@ jobs:
|
|||||||
run: coverage report --rcfile=pyproject.toml --data-file=.coverage
|
run: coverage report --rcfile=pyproject.toml --data-file=.coverage
|
||||||
|
|
||||||
- name: Convert to XML format (Cobertura)
|
- name: Convert to XML format (Cobertura)
|
||||||
if: inputs.coverage_xml_artifact != ''
|
if: inputs.coverage_xml_artifact != '' || inputs.codecov || inputs.codacy
|
||||||
run: coverage xml --data-file=.coverage
|
run: coverage xml --data-file=.coverage
|
||||||
|
|
||||||
- name: Convert to JSON format
|
- name: Convert to JSON format
|
||||||
@@ -154,12 +153,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
coverage html --data-file=.coverage -d report/coverage/html
|
coverage html --data-file=.coverage -d report/coverage/html
|
||||||
rm report/coverage/html/.gitignore
|
rm report/coverage/html/.gitignore
|
||||||
tree -a report/coverage/html
|
tree -pash report/coverage/html
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage SQLite Database' artifact
|
- name: 📤 Upload 'Coverage SQLite Database' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.coverage_sqlite_artifact != ''
|
if: inputs.coverage_sqlite_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_sqlite_artifact }}
|
name: ${{ inputs.coverage_sqlite_artifact }}
|
||||||
path: .coverage
|
path: .coverage
|
||||||
@@ -167,48 +166,69 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage XML Report' artifact
|
- name: 📤 Upload 'Coverage XML Report' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.coverage_xml_artifact != ''
|
if: inputs.coverage_xml_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_xml_artifact }}
|
name: ${{ inputs.coverage_xml_artifact }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
working-directory: ${{ inputs.coverage_report_xml_directory }}
|
||||||
|
path: ${{ inputs.coverage_report_xml_filename }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage JSON Report' artifact
|
- name: 📤 Upload 'Coverage JSON Report' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.coverage_json_artifact != ''
|
if: inputs.coverage_json_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_json_artifact }}
|
name: ${{ inputs.coverage_json_artifact }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_json }}
|
working-directory: ${{ inputs.coverage_report_json_directory }}
|
||||||
|
path: ${{ inputs.coverage_report_json_filename }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage HTML Report' artifact
|
- name: 📤 Upload 'Coverage HTML Report' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.coverage_html_artifact != ''
|
if: inputs.coverage_html_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_html_artifact }}
|
name: ${{ inputs.coverage_html_artifact }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
working-directory: ${{ inputs.coverage_report_html_directory }}
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📊 Publish code coverage at CodeCov
|
- name: 📊 Publish code coverage at CodeCov
|
||||||
if: inputs.CodeCov == true
|
uses: codecov/codecov-action@v5
|
||||||
|
id: codecov
|
||||||
|
if: inputs.codecov == 'true'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: codecov/codecov-action@v4
|
|
||||||
with:
|
with:
|
||||||
files: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
disable_search: true
|
||||||
|
files: ${{ inputs.coverage_report_xml_directory }}/${{ inputs.coverage_report_xml_filename }}
|
||||||
flags: unittests
|
flags: unittests
|
||||||
env_vars: PYTHON
|
env_vars: PYTHON
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|
||||||
- name: 📉 Publish code coverage at Codacy
|
- name: 📉 Publish code coverage at Codacy
|
||||||
if: inputs.Codacy == true
|
|
||||||
continue-on-error: true
|
|
||||||
uses: codacy/codacy-coverage-reporter-action@v1
|
uses: codacy/codacy-coverage-reporter-action@v1
|
||||||
|
id: codacy
|
||||||
|
if: inputs.codacy == 'true'
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
project-token: ${{ secrets.codacy_token }}
|
project-token: ${{ secrets.CODACY_TOKEN }}
|
||||||
coverage-reports: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
coverage-reports: ${{ inputs.coverage_report_xml_directory }}/${{ inputs.coverage_report_xml_filename }}
|
||||||
|
|
||||||
|
- name: Generate error messages
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.codecov.outcome }}" == "failure" ]]; then
|
||||||
|
printf "::error title=%s::%s\n" "Publish Code Coverage Results / Codecov" "Failed to publish code coverage results."
|
||||||
|
else
|
||||||
|
printf "Codecov: No errors to report.\n"
|
||||||
|
fi
|
||||||
|
if [[ "${{ steps.codacy.outcome }}" == "failure" ]]; then
|
||||||
|
printf "::error title=%s::%s\n" "Publish Code Coverage Results / Codacy" "Failed to publish code coverage results."
|
||||||
|
else
|
||||||
|
printf "Codacy: No errors to report.\n"
|
||||||
|
fi
|
||||||
|
|||||||
18
.github/workflows/PublishOnPyPI.yml
vendored
18
.github/workflows/PublishOnPyPI.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,10 +25,15 @@ name: Publish on PyPI
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip.'
|
description: 'Python dependencies to be installed through pip.'
|
||||||
@@ -45,17 +50,16 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
PublishOnPyPI:
|
PublishOnPyPI:
|
||||||
name: 🚀 Publish to PyPI
|
name: 🚀 Publish to PyPI
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job
|
- name: 📥 Download artifacts '${{ inputs.artifact }}' from 'Package' job
|
||||||
uses: actions/download-artifact@v4
|
uses: pyTooling/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
path: dist/
|
path: dist
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -78,6 +82,6 @@ jobs:
|
|||||||
run: twine upload dist/*.whl
|
run: twine upload dist/*.whl
|
||||||
|
|
||||||
- name: 🗑️ Delete packaging Artifacts
|
- name: 🗑️ Delete packaging Artifacts
|
||||||
uses: geekyeggo/delete-artifact@v4
|
uses: geekyeggo/delete-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
|
|||||||
831
.github/workflows/PublishReleaseNotes.yml
vendored
Normal file
831
.github/workflows/PublishReleaseNotes.yml
vendored
Normal file
@@ -0,0 +1,831 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# 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: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ubuntu_image:
|
||||||
|
description: 'Name of the Ubuntu image.'
|
||||||
|
required: false
|
||||||
|
default: 'ubuntu-24.04'
|
||||||
|
type: string
|
||||||
|
release_branch:
|
||||||
|
description: 'Name of the branch containing releases.'
|
||||||
|
required: false
|
||||||
|
default: 'main'
|
||||||
|
type: string
|
||||||
|
mode:
|
||||||
|
description: 'Release mode: nightly or release.'
|
||||||
|
required: false
|
||||||
|
default: 'release'
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
description: 'Name of the release (tag).'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
description: 'Title of the release.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
description:
|
||||||
|
description: 'Multi-line description of the release.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
description_file:
|
||||||
|
description: 'Description of the release from a Markdown file.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
description_footer:
|
||||||
|
description: 'Footer line(s) in every release.'
|
||||||
|
required: false
|
||||||
|
default: |
|
||||||
|
|
||||||
|
--------
|
||||||
|
Published from [%%gh_workflow_name%%](%%gh_server%%/%%gh_owner_repo%%/actions/runs/%%gh_runid%%) workflow triggered by %%gh_actor%% on %%datetime%%.
|
||||||
|
|
||||||
|
This automatic release was created by [pyTooling/Actions](http://github.com/pyTooling/Actions)::Release.yml
|
||||||
|
type: string
|
||||||
|
draft:
|
||||||
|
description: 'Specify if this is a draft.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
prerelease:
|
||||||
|
description: 'Specify if this is a pre-release.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
latest:
|
||||||
|
description: 'Specify if this is the latest release.'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
replacements:
|
||||||
|
description: 'Multi-line string containing search=replace patterns.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
assets:
|
||||||
|
description: 'Multi-line string containing artifact:file:title asset descriptions.'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
inventory-json:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
inventory-version:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
inventory-categories:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
tarball-name:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: '__pyTooling_upload_artifact__.tar'
|
||||||
|
can-fail:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
outputs:
|
||||||
|
release-page:
|
||||||
|
description: "URL to the release page."
|
||||||
|
value: ${{ jobs.Release.outputs.release-page }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Release:
|
||||||
|
name: 📝 Create or Update Release Page on GitHub
|
||||||
|
runs-on: ${{ inputs.ubuntu_image }}
|
||||||
|
continue-on-error: ${{ inputs.can-fail }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
actions: write
|
||||||
|
# attestations: write
|
||||||
|
outputs:
|
||||||
|
release-page: ${{ steps.removeDraft.outputs.release_page }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⏬ Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
# The command 'git describe' (used for version) needs the history.
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: 🔧 Install zstd
|
||||||
|
run: sudo apt-get install -y --no-install-recommends zstd
|
||||||
|
|
||||||
|
- name: 📑 Prepare
|
||||||
|
id: prepare
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
printf "Release mode: ${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "${{ inputs.mode }}"
|
||||||
|
case "${{ inputs.mode }}" in
|
||||||
|
"release")
|
||||||
|
;;
|
||||||
|
"nightly")
|
||||||
|
printf "→ Allow deletion and recreation of existing release pages for rolling releases (nightly releases)\n"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "Unknown mode '%s'\n" "${{ inputs.mode }}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Unknown mode '${{ inputs.mode }}'."
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
- name: 📑 Delete (old) Release Page
|
||||||
|
id: deleteReleasePage
|
||||||
|
if: inputs.mode == 'nightly'
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
printf "Deleting release '%s' ... " "${{ inputs.tag }}"
|
||||||
|
message="$(gh release delete ${{ inputs.tag }} --yes 2>&1)"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
elif [[ "${message}" == "release not found" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_YELLOW}[NOT FOUND]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't delete release '%s' -> Error: '%s'.${ANSI_NOCOLOR}\n" "${{ inputs.tag }}" "${message}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Couldn't delete release '${{ inputs.tag }}' -> Error: '${message}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📑 Assemble Release Notes
|
||||||
|
id: createReleaseNotes
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
# Save release description (from parameter in a file)
|
||||||
|
head -c -1 <<'EOF' > __DESCRIPTION__.md
|
||||||
|
${{ inputs.description }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Save release footer (from parameter in a file)
|
||||||
|
head -c -1 <<'EOF' > __FOOTER__.md
|
||||||
|
${{ inputs.description_footer }}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Download Markdown from PullRequest
|
||||||
|
# Readout second parent's SHA
|
||||||
|
# Search PR with that SHA
|
||||||
|
# Load description of that PR
|
||||||
|
printf "Read second parent of current SHA (%s) ... " "${{ github.ref }}"
|
||||||
|
FATHER_SHA=$(git rev-parse ${{ github.ref }}^2 -- 2> /dev/null)
|
||||||
|
if [[ $? -ne 0 || "{FATHER_SHA}" == "" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "→ ${ANSI_LIGHT_YELLOW}Skipped readout of pull request description. This is not a merge commit.${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
printf "Search Pull Request to '%s' and branch containing SHA %s ... " "${{ inputs.release_branch }}" "${FATHER_SHA}"
|
||||||
|
PULL_REQUESTS=$(gh pr list --base "${{ inputs.release_branch }}" --search "${FATHER_SHA}" --state "merged" --json "title,number,mergedBy,mergedAt,body")
|
||||||
|
if [[ $? -ne 0 || "${PULL_REQUESTS}" == "" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "${ANSI_LIGHT_RED}Couldn't find a merged Pull Request to '%s'. -> %s${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}" "${PULL_REQUESTS}"
|
||||||
|
printf "::error title=PullRequest::Couldn't find a merged Pull Request to '%s'. -> %s\n" "${{ inputs.release_branch }}" "${PULL_REQUESTS}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
PR_TITLE="$( printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].title")"
|
||||||
|
PR_NUMBER="$( printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].number")"
|
||||||
|
PR_BODY="$( printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].body")"
|
||||||
|
PR_MERGED_BY="$(printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].mergedBy.login")"
|
||||||
|
PR_MERGED_AT="$(printf "%s\n" "${PULL_REQUESTS}" | jq --raw-output ".[0].mergedAt")"
|
||||||
|
|
||||||
|
printf "Found Pull Request:\n"
|
||||||
|
printf " %s\n" "Title: ${PR_TITLE}"
|
||||||
|
printf " %s\n" "Number: ${PR_NUMBER}"
|
||||||
|
printf " %s\n" "MergedBy: ${PR_MERGED_BY}"
|
||||||
|
printf " %s\n" "MergedAt: ${PR_MERGED_AT} ($(date -d"${PR_MERGED_AT}" '+%d.%m.%Y - %H:%M:%S'))"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${PR_BODY}" > __PULLREQUEST__.md
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if a release description file should be used and exists.
|
||||||
|
if [[ "${{ inputs.description_file }}" != "" ]]; then
|
||||||
|
if [[ ! -f "${{ inputs.description_file }}" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}Release description file '%s' not found.${ANSI_NOCOLOR}\n" "${{ inputs.description_file }}"
|
||||||
|
printf "::error title=%s::%s\n" "FileNotFound" "Release description file '${{ inputs.description_file }}' not found."
|
||||||
|
exit 1
|
||||||
|
elif [[ -s "${{ inputs.description_file }}" ]]; then
|
||||||
|
printf "Use '%s' as main release description.\n" "${{ inputs.description_file }}"
|
||||||
|
cp -v "${{ inputs.description_file }}" __NOTES__.md
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}Release description file '%s' is empty.${ANSI_NOCOLOR}\n" "${{ inputs.description_file }}"
|
||||||
|
printf "::error title=%s::%s\n" "FileNotFound" "Release description file '${{ inputs.description_file }}' is empty."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Check if the main release description is provided by a template parameter
|
||||||
|
elif [[ -s __DESCRIPTION__.md ]]; then
|
||||||
|
printf "Use '__DESCRIPTION__.md' as main release description.\n"
|
||||||
|
mv -v __DESCRIPTION__.md __NOTES__.md
|
||||||
|
# Check if the pull request serves as the main release description text.
|
||||||
|
elif [[ -s __PULLREQUEST__.md ]]; then
|
||||||
|
printf "Use '__PULLREQUEST__.md' as main release description.\n"
|
||||||
|
mv -v __PULLREQUEST__.md __NOTES__.md
|
||||||
|
|
||||||
|
printf "Append '%%%%FOOTER%%%%' to '__NOTES__.md'.\n"
|
||||||
|
printf "\n%%%%FOOTER%%%%\n" >> __NOTES__.md
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}No release description specified (file, parameter, PR text).${ANSI_NOCOLOR}\n"
|
||||||
|
printf "::error title=%s::%s\n" "MissingDescription" "No release description specified (file, parameter, PR text)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read release notes main file for placeholder substitution
|
||||||
|
NOTES=$(<__NOTES__.md)
|
||||||
|
|
||||||
|
# Inline description
|
||||||
|
if [[ -s __DESCRIPTION__.md ]]; then
|
||||||
|
NOTES="${NOTES//%%DESCRIPTION%%/$(<__DESCRIPTION__.md)}"
|
||||||
|
else
|
||||||
|
NOTES="${NOTES//%%DESCRIPTION%%/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Inline PullRequest and increase headline levels
|
||||||
|
if [[ -s __PULLREQUEST__.md ]]; then
|
||||||
|
while [[ "${NOTES}" =~ %%(PULLREQUEST(\+[0-3])?)%% ]]; do
|
||||||
|
case "${BASH_REMATCH[1]}" in
|
||||||
|
"PULLREQUEST+0" | "PULLREQUEST")
|
||||||
|
NOTES="${NOTES//${BASH_REMATCH[0]}/$(<__PULLREQUEST__.md)}"
|
||||||
|
;;
|
||||||
|
"PULLREQUEST+1")
|
||||||
|
NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1# /gm;t')}"
|
||||||
|
;;
|
||||||
|
"PULLREQUEST+2")
|
||||||
|
NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1### /gm;t')}"
|
||||||
|
;;
|
||||||
|
"PULLREQUEST+3")
|
||||||
|
NOTES="${NOTES//${BASH_REMATCH[0]}/$(cat __PULLREQUEST__.md | sed -E 's/^(#+) /\1### /gm;t')}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
else
|
||||||
|
while [[ "${NOTES}" =~ %%(PULLREQUEST(\+[0-3])?)%% ]]; do
|
||||||
|
NOTES="${NOTES//${BASH_REMATCH[0]}/}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# inline Footer
|
||||||
|
if [[ -s __FOOTER__.md ]]; then
|
||||||
|
NOTES="${NOTES//%%FOOTER%%/$(<__FOOTER__.md)}"
|
||||||
|
else
|
||||||
|
NOTES="${NOTES//%%FOOTER%%/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply replacements
|
||||||
|
while IFS=$'\r\n' read -r patternLine; do
|
||||||
|
# skip empty lines
|
||||||
|
[[ "$patternLine" == "" ]] && continue
|
||||||
|
|
||||||
|
pattern="%${patternLine%%=*}%"
|
||||||
|
replacement="${patternLine#*=}"
|
||||||
|
NOTES="${NOTES//$pattern/$replacement}"
|
||||||
|
done <<<'${{ inputs.replacements }}'
|
||||||
|
|
||||||
|
# Workarounds for stupid GitHub variables
|
||||||
|
owner_repo="${{ github.repository }}"
|
||||||
|
repo=${owner_repo##*/}
|
||||||
|
|
||||||
|
# Replace special identifiers
|
||||||
|
NOTES="${NOTES//%%gh_server%%/${{ github.server_url }}}"
|
||||||
|
NOTES="${NOTES//%%gh_workflow_name%%/${{ github.workflow }}}"
|
||||||
|
NOTES="${NOTES//%%gh_owner%%/${{ github.repository_owner }}}"
|
||||||
|
NOTES="${NOTES//%%gh_repo%%/${repo}}"
|
||||||
|
NOTES="${NOTES//%%gh_owner_repo%%/${{ github.repository_owner }}}"
|
||||||
|
#NOTES="${NOTES//%%gh_pages%%/https://${{ github.repository_owner }}.github.io/${repo}/}"
|
||||||
|
NOTES="${NOTES//%%gh_runid%%/${{ github.run_id }}}"
|
||||||
|
NOTES="${NOTES//%%gh_actor%%/${{ github.actor }}}"
|
||||||
|
NOTES="${NOTES//%%gh_sha%%/${{ github.sha }}}"
|
||||||
|
NOTES="${NOTES//%%date%%/$(date '+%Y-%m-%d')}"
|
||||||
|
NOTES="${NOTES//%%time%%/$(date '+%H:%M:%S %Z')}"
|
||||||
|
NOTES="${NOTES//%%datetime%%/$(date '+%Y-%m-%d %H:%M:%S %Z')}"
|
||||||
|
|
||||||
|
# Write final release notes to file
|
||||||
|
echo "${NOTES}" > __NOTES__.md
|
||||||
|
|
||||||
|
# Display partial contents for debugging
|
||||||
|
if [[ -s __DESCRIPTION__.md ]]; then
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Content of '__DESCRIPTION__.md' ($(stat --printf="%s" "__DESCRIPTION__.md") B) ...."
|
||||||
|
cat __DESCRIPTION__.md
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_YELLOW}No '__DESCRIPTION__.md' found.${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
if [[ -s __PULLREQUEST__.md ]]; then
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Content of '__PULLREQUEST__.md' ($(stat --printf="%s" "__PULLREQUEST__.md") B) ...."
|
||||||
|
cat __PULLREQUEST__.md
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_YELLOW}No '__PULLREQUEST__.md' found.${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
if [[ -s __FOOTER__.md ]]; then
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Content of '__FOOTER__.md' ($(stat --printf="%s" "__FOOTER__.md") B) ...."
|
||||||
|
cat __FOOTER__.md
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_YELLOW}No '__FOOTER__.md' found.${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print final release notes
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Content of '__NOTES__.md' ($(stat --printf="%s" "__NOTES__.md") B) ...."
|
||||||
|
cat __NOTES__.md
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
|
||||||
|
- name: 📑 Create new Release Page
|
||||||
|
id: createReleasePage
|
||||||
|
if: inputs.mode == 'release'
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
if [[ "${{ inputs.prerelease }}" == "true" ]]; then
|
||||||
|
addPreRelease="--prerelease"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.latest }}" == "false" ]]; then
|
||||||
|
addLatest="--latest=false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.title }}" != "" ]]; then
|
||||||
|
addTitle=("--title" "${{ inputs.title }}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -s __NOTES__.md ]]; then
|
||||||
|
addNotes=("--notes-file" "__NOTES__.md")
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "Creating release '%s' ... " "${{ inputs.tag }}"
|
||||||
|
message="$(gh release create "${{ inputs.tag }}" --verify-tag --draft $addPreRelease $addLatest "${addTitle[@]}" "${addNotes[@]}" 2>&1)"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " Release page: %s\n" "${message}"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't create release '%s' -> Error: '%s'.${ANSI_NOCOLOR}\n" "${{ inputs.tag }}" "${message}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Couldn't create release '${{ inputs.tag }}' -> Error: '${message}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📑 Recreate Release Page
|
||||||
|
id: recreateReleasePage
|
||||||
|
if: inputs.mode == 'nightly'
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
addDraft="--draft"
|
||||||
|
if [[ "${{ inputs.prerelease }}" == "true" ]]; then
|
||||||
|
addPreRelease="--prerelease"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.latest }}" == "false" ]]; then
|
||||||
|
addLatest="--latest=false"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ inputs.title }}" != "" ]]; then
|
||||||
|
addTitle=("--title" "${{ inputs.title }}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -s __NOTES__.md ]]; then
|
||||||
|
addNotes=("--notes-file" "__NOTES__.md")
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "Creating release '%s' ... " "${{ inputs.tag }}"
|
||||||
|
message="$(gh release create "${{ inputs.tag }}" --verify-tag --draft $addPreRelease $addLatest "${addTitle[@]}" "${addNotes[@]}" 2>&1)"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " Release page: %s\n" "${message}"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't recreate release '%s' -> Error: '%s'.${ANSI_NOCOLOR}\n" "${{ inputs.tag }}" "${message}"
|
||||||
|
printf "::error title=%s::%s\n" "InternalError" "Couldn't recreate release '${{ inputs.tag }}' -> Error: '${message}'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📥 Download artifacts and upload as assets
|
||||||
|
id: uploadAssets
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_LIGHT_YELLOW=$'\x1b[93m'
|
||||||
|
ANSI_LIGHT_BLUE=$'\x1b[94m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
Replace() {
|
||||||
|
line="$1"
|
||||||
|
while IFS=$'\r\n' read -r patternLine; do
|
||||||
|
# skip empty lines
|
||||||
|
[[ "$patternLine" == "" ]] && continue
|
||||||
|
|
||||||
|
pattern="${patternLine%%=*}"
|
||||||
|
replacement="${patternLine#*=}"
|
||||||
|
line="${line//"%$pattern%"/"$replacement"}"
|
||||||
|
done <<<'${{ inputs.replacements }}'
|
||||||
|
printf "%s\n" "$line"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create JSON inventory
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
VERSION="1.0"
|
||||||
|
|
||||||
|
# Split categories by ',' into a Bash array.
|
||||||
|
# See https://stackoverflow.com/a/45201229/3719459
|
||||||
|
if [[ "${{ inputs.inventory-categories }}" != "" ]]; then
|
||||||
|
readarray -td, inventoryCategories <<<"${{ inputs.inventory-categories }},"
|
||||||
|
unset 'inventoryCategories[-1]'
|
||||||
|
declare -p inventoryCategories
|
||||||
|
else
|
||||||
|
inventoryCategories=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
jsonInventory=$(jq -c -n \
|
||||||
|
--arg version "${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 categories "$(jq -c -n \
|
||||||
|
'$ARGS.positional' \
|
||||||
|
--args "${inventoryCategories[@]}" \
|
||||||
|
)" \
|
||||||
|
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories}' \
|
||||||
|
)" \
|
||||||
|
'{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
ERRORS=0
|
||||||
|
# A dictionary of 0/1 to avoid duplicate downloads
|
||||||
|
declare -A downloadedArtifacts
|
||||||
|
# A dictionary to check for duplicate asset files in release
|
||||||
|
declare -A assetFilenames
|
||||||
|
# A dictionary of SHA256 checksums
|
||||||
|
declare -A sha256Checksums
|
||||||
|
while IFS=$'\r\n' read -r assetLine; do
|
||||||
|
if [[ "${assetLine}" == "" || "${assetLine:0:1}" == "#" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# split assetLine colon separated triple: artifact:asset:title
|
||||||
|
artifact="${assetLine%%:*}"
|
||||||
|
assetLine="${assetLine#*:}"
|
||||||
|
asset="${assetLine%%:*}"
|
||||||
|
assetLine="${assetLine#*:}"
|
||||||
|
if [[ "${{ inputs.inventory-json }}" == "" ]]; then
|
||||||
|
categories=""
|
||||||
|
title="${assetLine##*:}"
|
||||||
|
else
|
||||||
|
categories="${assetLine%%:*}"
|
||||||
|
title="${assetLine##*:}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove leading whitespace
|
||||||
|
asset="${asset#"${asset%%[![:space:]]*}"}"
|
||||||
|
categories="${categories#"${categories%%[![:space:]]*}"}"
|
||||||
|
title="${title#"${title%%[![:space:]]*}"}"
|
||||||
|
|
||||||
|
# apply replacements
|
||||||
|
asset="$(Replace "${asset}")"
|
||||||
|
title="$(Replace "${title}")"
|
||||||
|
|
||||||
|
printf "${ANSI_LIGHT_BLUE}Publish asset '%s' from artifact '%s' with title '%s'${ANSI_NOCOLOR}\n" "${asset}" "${artifact}" "${title}"
|
||||||
|
printf " Checked asset for duplicates ... "
|
||||||
|
if [[ -n "${assetFilenames[$asset]}" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf "::error title=%s::%s\n" "DuplicateAsset" "Asset '${asset}' from artifact '${artifact}' was already uploaded to release '${{ inputs.tag }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
assetFilenames[$asset]=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download artifact by artifact name
|
||||||
|
if [[ -n "${downloadedArtifacts[$artifact]}" ]]; then
|
||||||
|
printf " downloading artifact '%s' ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n" "${artifact}"
|
||||||
|
else
|
||||||
|
echo " downloading '${artifact}' ... "
|
||||||
|
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
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't download artifact '%s'.${ANSI_NOCOLOR}\n" "${artifact}"
|
||||||
|
printf "::error title=%s::%s\n" "ArtifactNotFound" "Couldn't download artifact '${artifact}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
downloadedArtifacts[$artifact]=1
|
||||||
|
|
||||||
|
printf " Checking for embedded tarball ... "
|
||||||
|
if [[ -f "${artifact}/${{ inputs.tarball-name }}" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[FOUND]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
pushd "${artifact}" > /dev/null
|
||||||
|
|
||||||
|
printf " Extracting embedded tarball ... "
|
||||||
|
tar -xf "${{ inputs.tarball-name }}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf " Removing temporary tarball ... "
|
||||||
|
rm -f "${{ inputs.tarball-name }}"
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if artifact should be compressed (zip, tgz) or if asset was part of the downloaded artifact.
|
||||||
|
printf " checking asset '%s' ... " "${artifact}/${asset}"
|
||||||
|
if [[ "${asset}" == !*.zip ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[ZIP]${ANSI_NOCOLOR}\n"
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf "::group:: %s\n" "Compressing artifact '${artifact}' to '${asset}' ..."
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
zip -r "../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't compress '%s' to zip file '%s'.${ANSI_NOCOLOR}\n" "${artifact}" "${asset}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to zip file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ "${asset}" == !*.tgz || "${asset}" == !*.tar.gz || "${asset}" == \$*.tgz || "${asset}" == \$*.tar.gz ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[TAR/GZ]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
if [[ "${asset:0:1}" == "\$" ]]; then
|
||||||
|
asset="${asset##*$}"
|
||||||
|
dirName="${asset%.*}"
|
||||||
|
printf " Compressing artifact '%s' to '%s' ...\n" "${artifact}" "${asset}"
|
||||||
|
tar -c --gzip --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" .
|
||||||
|
retCode=$?
|
||||||
|
else
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf " Compressing artifact '%s' to '%s' ...\n" "${artifact}" "${asset}"
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
tar -c --gzip --owner=0 --group=0 --file="../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't compress '%s' to tgz file '%s'.${ANSI_NOCOLOR}\n" "${artifact}" "${asset}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to tgz file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ "${asset}" == !*.tzst || "${asset}" == !*.tar.zst || "${asset}" == \$*.tzst || "${asset}" == \$*.tar.zst ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[ZST]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
if [[ "${asset:0:1}" == "\$" ]]; then
|
||||||
|
asset="${asset##*$}"
|
||||||
|
dirName="${asset%.*}"
|
||||||
|
printf " Compressing artifact '%s' to '%s' ...\n" "${artifact}" "${asset}"
|
||||||
|
tar -c --zstd --owner=0 --group=0 --file="${asset}" --directory="${artifact}" --transform "s|^\.|${dirName%.tar}|" .
|
||||||
|
retCode=$?
|
||||||
|
else
|
||||||
|
asset="${asset##*!}"
|
||||||
|
printf " Compressing artifact '%s' to '%s' ...\n" "${artifact}" "${asset}"
|
||||||
|
(
|
||||||
|
cd "${artifact}" && \
|
||||||
|
tar -c --zstd --owner=0 --group=0 --file="../${asset}" *
|
||||||
|
)
|
||||||
|
retCode=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $retCode -eq 0 ]]; then
|
||||||
|
printf " Compression ${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
uploadFile="${asset}"
|
||||||
|
else
|
||||||
|
printf " Compression ${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't compress '%s' to zst file '%s'.${ANSI_NOCOLOR}\n" "${artifact}" "${asset}"
|
||||||
|
printf "::error title=%s::%s\n" "CompressionError" "Couldn't compress '${artifact}' to zst file '${asset}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
elif [[ -e "${artifact}/${asset}" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
uploadFile="${artifact}/${asset}"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't find asset '%s' in artifact '%s'.${ANSI_NOCOLOR}\n" "${asset}" "${artifact}"
|
||||||
|
printf "::error title=%s::%s\n" "FileNotFound" "Couldn't find asset '${asset}' in artifact '${artifact}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf " compute SHA256 checksum of '${uploadFile}' ... "
|
||||||
|
sha256=$(sha256sum -b ${uploadFile} | cut -d " " -f1)
|
||||||
|
sha256Checksums[$asset]="sha256:${sha256}"
|
||||||
|
printf "${ANSI_LIGHT_BLUE}${sha256}${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
# Add asset to JSON inventory
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
if [[ "${categories}" != "${title}" ]]; then
|
||||||
|
printf " adding file '%s' with '%s' to JSON inventory ...\n" "${uploadFile#*/}" "${categories//;/ → }"
|
||||||
|
category=""
|
||||||
|
jsonEntry=$(jq -c -n \
|
||||||
|
--arg title "${title}" \
|
||||||
|
--arg sha256 "${sha256}" \
|
||||||
|
--arg file "${uploadFile#*/}" \
|
||||||
|
'{"file": $file, "sha256": $sha256, "title": $title}' \
|
||||||
|
)
|
||||||
|
|
||||||
|
while [[ "${categories}" != "${category}" ]]; do
|
||||||
|
category="${categories##*,}"
|
||||||
|
categories="${categories%,*}"
|
||||||
|
jsonEntry=$(jq -c -n --arg cat "${category}" --argjson value "${jsonEntry}" '{$cat: $value}')
|
||||||
|
done
|
||||||
|
|
||||||
|
jsonInventory=$(jq -c -n \
|
||||||
|
--argjson inventory "${jsonInventory}" \
|
||||||
|
--argjson file "${jsonEntry}" \
|
||||||
|
'$inventory * {"files": $file}' \
|
||||||
|
)
|
||||||
|
else
|
||||||
|
printf " adding file '%s' to JSON inventory ... ${ANSI_LIGHT_YELLOW}[SKIPPED]${ANSI_NOCOLOR}\n" "${uploadFile#*/}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Upload asset to existing release page
|
||||||
|
printf " uploading asset '%s' from '%s' with title '%s' ... " "${asset}" "${uploadFile}" "${title}"
|
||||||
|
gh release upload ${{ inputs.tag }} "${uploadFile}#${title}" --clobber
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
|
||||||
|
printf " checking assets SHA256 checksum ... \n"
|
||||||
|
ghSHA256=$(gh release view --json assets --jq ".assets[] | select(.name == \"${asset}\") | .digest" ${{ inputs.tag }})
|
||||||
|
if [[ "${ghSHA256}" == "${sha256Checksums[$asset]}" ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[PASSED]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}SHA256 checksum compare failed.${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Local: %s${ANSI_NOCOLOR}\n" "${sha256Checksums[$asset]}"
|
||||||
|
printf " ${ANSI_LIGHT_RED}GitHub: %s${ANSI_NOCOLOR}\n" "${ghSHA256}"
|
||||||
|
printf "::error title=%s::%s\n" "ChecksumError" "SHA256 checksum compare failed. Local=${sha256Checksums[$asset]} GitHub=${ghSHA256}"
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't upload asset '%s' from '%s' to release '%s'.${ANSI_NOCOLOR}\n" "${asset}" "${uploadFile}" "${{ inputs.tag }}"
|
||||||
|
printf "::error title=%s::%s\n" "UploadError" "Couldn't upload asset '${asset}' from '${uploadFile}' to release '${{ inputs.tag }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
done <<<'${{ inputs.assets }}'
|
||||||
|
|
||||||
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
|
inventoryTitle="Release Inventory (JSON)"
|
||||||
|
|
||||||
|
printf "Publish asset '%s' with title '%s'\n" "${{ inputs.inventory-json }}" "${inventoryTitle}"
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Writing JSON inventory to '${{ inputs.inventory-json }}' ...."
|
||||||
|
printf "%s\n" "$(jq -n --argjson inventory "${jsonInventory}" '$inventory')" > "${{ inputs.inventory-json }}"
|
||||||
|
cat "${{ inputs.inventory-json }}"
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
|
||||||
|
# Upload inventory asset to existing release page
|
||||||
|
printf " uploading asset '%s' title '%s' ... " "${{ inputs.inventory-json }}" "${inventoryTitle}"
|
||||||
|
gh release upload ${{ inputs.tag }} "${{ inputs.inventory-json }}#${inventoryTitle}" --clobber
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't upload asset '%s' to release '%s'.${ANSI_NOCOLOR}\n" "${{ inputs.inventory-json }}" "${{ inputs.tag }}"
|
||||||
|
printf "::error title=%s::%s\n" "UploadError" "Couldn't upload asset '${{ inputs.inventory-json }}' to release '${{ inputs.tag }}'."
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Inspecting downloaded artifacts ..."
|
||||||
|
tree -pash -L 3 .
|
||||||
|
printf "::endgroup::\n"
|
||||||
|
|
||||||
|
if [[ $ERRORS -ne 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_RED}%s errors detected in previous steps.${ANSI_NOCOLOR}\n" "${ERRORS}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📑 Remove draft state from Release Page
|
||||||
|
id: removeDraft
|
||||||
|
if: ${{ ! inputs.draft }}
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
|
||||||
|
ANSI_LIGHT_RED=$'\x1b[91m'
|
||||||
|
ANSI_LIGHT_GREEN=$'\x1b[92m'
|
||||||
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
|
export GH_TOKEN=${{ github.token }}
|
||||||
|
|
||||||
|
# Remove draft-state from release page
|
||||||
|
printf "Remove draft-state from release '%s' ... " "${title}"
|
||||||
|
releasePage=$(gh release edit --draft=false "${{ inputs.tag }}")
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " Release page: %s\n" "${releasePage}"
|
||||||
|
|
||||||
|
printf "release_page=%s\n" "${releasePage}" >> "${GITHUB_OUTPUT}"
|
||||||
|
else
|
||||||
|
printf "${ANSI_LIGHT_RED}[ERROR]${ANSI_NOCOLOR}\n"
|
||||||
|
printf " ${ANSI_LIGHT_RED}Couldn't remove draft-state from release '%s'.${ANSI_NOCOLOR}\n" "${{ inputs.tag }}"
|
||||||
|
printf "::error title=%s::%s\n" "ReleasePage" "Couldn't remove draft-state from release '${{ inputs.tag }}'."
|
||||||
|
fi
|
||||||
143
.github/workflows/PublishTestResults.yml
vendored
143
.github/workflows/PublishTestResults.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,65 +25,150 @@ name: Publish Unit Test Results
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
|
unittest_artifacts_pattern:
|
||||||
|
required: false
|
||||||
|
default: '*-UnitTestReportSummary-XML-*'
|
||||||
|
type: string
|
||||||
|
merged_junit_filename:
|
||||||
|
description: 'Filename of the merged JUnit Test Summary.'
|
||||||
|
required: false
|
||||||
|
default: 'Unittesting.xml'
|
||||||
|
type: string
|
||||||
merged_junit_artifact:
|
merged_junit_artifact:
|
||||||
description: 'Name of the merged JUnit Test Summary artifact.'
|
description: 'Name of the merged JUnit Test Summary artifact.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
additional_merge_args:
|
||||||
|
description: 'Additional merging arguments.'
|
||||||
|
required: false
|
||||||
|
default: '"--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit"'
|
||||||
|
type: string
|
||||||
|
testsuite-summary-name:
|
||||||
|
description: 'Set TestsuiteSummary name.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
publish:
|
||||||
|
description: 'Publish test report summary via Dorny Test-Reporter'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
type: string
|
||||||
|
report_title:
|
||||||
|
description: 'Title of the summary report in the pipeline''s sidebar'
|
||||||
|
required: false
|
||||||
|
default: 'Unit Test Results'
|
||||||
|
type: string
|
||||||
|
dorny:
|
||||||
|
description: 'Publish merged unittest results via Dorny Test-Reporter.'
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
type: string
|
||||||
|
codecov:
|
||||||
|
description: 'Publish merged unittest results to Codecov.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
type: string
|
||||||
|
codecov_flags:
|
||||||
|
description: 'Flags applied to the upload to Codecov'
|
||||||
|
required: false
|
||||||
|
default: 'unittest'
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN:
|
||||||
|
description: 'Token to push result to Codecov.'
|
||||||
|
required: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
PublishTestResults:
|
PublishTestResults:
|
||||||
name: 📊 Publish Test Results
|
name: 📊 Publish Test Results
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Download Artifacts
|
- name: 📥 Download Artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: pyTooling/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
pattern: ${{ inputs.unittest_artifacts_pattern }}
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
- name: 🔧 Install junitparser
|
- name: 🔎 Inspect extracted artifact (tarball)
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --disable-pip-version-check -U junitparser
|
tree -pash artifacts
|
||||||
|
|
||||||
- name: Move JUnit files and collect them all to junit/
|
- name: 🔧 Install pyEDAA.Reports (JUunit Parser and Merger)
|
||||||
|
run: |
|
||||||
|
python -m pip install --disable-pip-version-check --break-system-packages -U pyEDAA.Reports
|
||||||
|
|
||||||
|
- name: Rename JUnit files and move them all into 'junit/'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p junit
|
mkdir -p junit
|
||||||
find . -type f -path "*artifacts*UnitTestReportSummary*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';'
|
find artifacts/ -type f -path "*.xml" -exec sh -c 'cp -v $0 "junit/$(basename $(dirname $0)).$(basename $0)"' {} ';'
|
||||||
tree -a junit
|
tree -pash junit
|
||||||
|
|
||||||
- name: 🔁 Merge JUnit Unit Test Summaries
|
- name: 🔁 Merge JUnit Unit Test Summaries
|
||||||
shell: python
|
|
||||||
run: |
|
run: |
|
||||||
from pathlib import Path
|
pyedaa-reports -v unittest "--name=${{ inputs.testsuite-summary-name }}" "--merge=pyTest-JUnit:junit/*.xml" ${{ inputs.additional_merge_args }} "--output=pyTest-JUnit:${{ inputs.merged_junit_filename }}"
|
||||||
from junitparser import JUnitXml
|
printf "%s\n" "cat ${{ inputs.merged_junit_filename }}"
|
||||||
|
cat ${{ inputs.merged_junit_filename }}
|
||||||
junitDirectory = Path("junit")
|
|
||||||
junitXml = None
|
|
||||||
for file in junitDirectory.iterdir():
|
|
||||||
if junitXml is None:
|
|
||||||
junitXml = JUnitXml.fromfile(file)
|
|
||||||
else:
|
|
||||||
junitXml += JUnitXml.fromfile(file)
|
|
||||||
|
|
||||||
junitXml.write(junitDirectory / "merged.xml")
|
|
||||||
|
|
||||||
- name: 📊 Publish Unit Test Results
|
- name: 📊 Publish Unit Test Results
|
||||||
uses: dorny/test-reporter@v1
|
uses: dorny/test-reporter@v2
|
||||||
|
id: test-reporter
|
||||||
|
if: ( inputs.dorny == 'true' || inputs.publish == 'true' ) && inputs.report_title != ''
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: Unit Test Results
|
name: ${{ inputs.report_title }}
|
||||||
path: junit/merged.xml
|
path: ${{ inputs.merged_junit_filename }}
|
||||||
reporter: java-junit
|
reporter: java-junit
|
||||||
|
|
||||||
|
- name: 📊 Publish unittest results at CodeCov
|
||||||
|
uses: codecov/test-results-action@v1
|
||||||
|
id: codecov
|
||||||
|
if: inputs.codecov == 'true'
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
disable_search: true
|
||||||
|
files: ${{ inputs.merged_junit_filename }}
|
||||||
|
flags: ${{ inputs.codecov_flags }}
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|
||||||
- name: 📤 Upload merged 'JUnit Test Summary' artifact
|
- name: 📤 Upload merged 'JUnit Test Summary' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.merged_junit_artifact != ''
|
if: inputs.merged_junit_artifact != ''
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.merged_junit_artifact }}
|
name: ${{ inputs.merged_junit_artifact }}
|
||||||
path: junit/merged.xml
|
path: ${{ inputs.merged_junit_filename }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
investigate: true
|
||||||
|
|
||||||
|
- name: Generate error messages
|
||||||
|
run: |
|
||||||
|
exitCode=0
|
||||||
|
if [[ "${{ steps.test-reporter.outcome }}" == "failure" ]]; then
|
||||||
|
printf "❌ Dorney/Test-Reporter: %s\n" "Failed to publish unittest results."
|
||||||
|
printf "::error title=%s::%s\n" "Dorney/Test-Reporter" "Failed to publish unittest results."
|
||||||
|
exitCode=1
|
||||||
|
else
|
||||||
|
printf "✅ Dorney/Test-Reporter: No errors to report.\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ steps.codecov.outcome }}" == "failure" ]]; then
|
||||||
|
printf "❌ CodeCov: %s\n" "Failed to publish unittest and code coverage results."
|
||||||
|
printf "::error title=%s::%s\n" "CodeCov" "Failed to publish unittest and code coverage results."
|
||||||
|
exitCode=1
|
||||||
|
else
|
||||||
|
printf "✅ CodeCov: No errors to report.\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $exitCode
|
||||||
|
|||||||
19
.github/workflows/PublishToGitHubPages.yml
vendored
19
.github/workflows/PublishToGitHubPages.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,6 +25,11 @@ name: Publish to GitHub Pages
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
doc:
|
doc:
|
||||||
description: 'Name of the documentation artifact.'
|
description: 'Name of the documentation artifact.'
|
||||||
required: true
|
required: true
|
||||||
@@ -44,28 +49,28 @@ jobs:
|
|||||||
|
|
||||||
PublishToGitHubPages:
|
PublishToGitHubPages:
|
||||||
name: 📚 Publish to GH-Pages
|
name: 📚 Publish to GH-Pages
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'BuildTheDocs' job
|
- name: 📥 Download artifacts '${{ inputs.doc }}' from 'SphinxDocumentation' job
|
||||||
uses: actions/download-artifact@v4
|
uses: pyTooling/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.doc }}
|
name: ${{ inputs.doc }}
|
||||||
path: public
|
path: public
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.coverage }}' from 'Coverage' job
|
- name: 📥 Download artifacts '${{ inputs.coverage }}' from 'Coverage' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
if: ${{ inputs.coverage != '' }}
|
if: ${{ inputs.coverage != '' }}
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage }}
|
name: ${{ inputs.coverage }}
|
||||||
path: public/coverage
|
path: public/coverage
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.typing }}' from 'StaticTypeCheck' job
|
- name: 📥 Download artifacts '${{ inputs.typing }}' from 'StaticTypeCheck' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
if: ${{ inputs.typing != '' }}
|
if: ${{ inputs.typing != '' }}
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.typing }}
|
name: ${{ inputs.typing }}
|
||||||
path: public/typing
|
path: public/typing
|
||||||
|
|||||||
243
.github/workflows/SphinxDocumentation.yml
vendored
243
.github/workflows/SphinxDocumentation.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Patrick Lehmann #
|
# Patrick Lehmann #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -24,26 +24,30 @@ name: Documentation
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip.'
|
description: 'Python dependencies to be installed through pip.'
|
||||||
required: false
|
required: false
|
||||||
default: '-r doc/requirements.txt'
|
default: '-r doc/requirements.txt'
|
||||||
type: string
|
type: string
|
||||||
coverage_config:
|
|
||||||
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
|
||||||
required: false
|
|
||||||
default: 'pyproject.toml'
|
|
||||||
type: string
|
|
||||||
doc_directory:
|
doc_directory:
|
||||||
description: 'Path to the directory containing documentation (Sphinx working directory).'
|
description: 'Path to the directory containing documentation (Sphinx working directory).'
|
||||||
required: false
|
required: false
|
||||||
default: 'doc'
|
default: 'doc'
|
||||||
type: string
|
type: string
|
||||||
|
coverage_report_json_directory:
|
||||||
|
description: ''
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
coverage_json_artifact:
|
coverage_json_artifact:
|
||||||
description: 'Name of the coverage JSON artifact.'
|
description: 'Name of the coverage JSON artifact.'
|
||||||
required: false
|
required: false
|
||||||
@@ -71,13 +75,16 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Sphinx:
|
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-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
- name: 🔧 Install graphviz
|
- name: 🔧 Install graphviz
|
||||||
run: sudo apt-get install -y --no-install-recommends graphviz
|
run: sudo apt-get install -y --no-install-recommends graphviz
|
||||||
@@ -89,80 +96,24 @@ jobs:
|
|||||||
|
|
||||||
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --disable-pip-version-check -U wheel tomli
|
python -m pip install --disable-pip-version-check -U wheel
|
||||||
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
|
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 and no '.coveragerc' file specified.")
|
|
||||||
|
|
||||||
# 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.")
|
|
||||||
|
|
||||||
# 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}")
|
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job
|
- name: 📥 Download artifacts '${{ inputs.unittest_xml_artifact }}' from 'Unittesting' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
if: inputs.unittest_xml_artifact != ''
|
if: inputs.unittest_xml_artifact != ''
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.unittest_xml_artifact }}
|
name: ${{ inputs.unittest_xml_artifact }}
|
||||||
path: ${{ inputs.unittest_xml_directory }}
|
path: ${{ inputs.unittest_xml_directory }}
|
||||||
|
investigate: true
|
||||||
|
|
||||||
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
|
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
if: inputs.coverage_json_artifact != ''
|
if: inputs.coverage_json_artifact != ''
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_json_artifact }}
|
name: ${{ inputs.coverage_json_artifact }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_json_directory }}
|
path: ${{ inputs.coverage_report_json_directory }}
|
||||||
|
investigate: true
|
||||||
|
|
||||||
- name: ☑ Generate HTML documentation
|
- name: ☑ Generate HTML documentation
|
||||||
if: inputs.html_artifact != ''
|
if: inputs.html_artifact != ''
|
||||||
@@ -172,6 +123,57 @@ jobs:
|
|||||||
cd "${{ inputs.doc_directory || '.' }}"
|
cd "${{ inputs.doc_directory || '.' }}"
|
||||||
sphinx-build -v -n -b html -d _build/doctrees -j $(nproc) -w _build/html.log . _build/html
|
sphinx-build -v -n -b html -d _build/doctrees -j $(nproc) -w _build/html.log . _build/html
|
||||||
|
|
||||||
|
- name: 📤 Upload 'HTML Documentation' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
|
if: inputs.html_artifact != ''
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.html_artifact }}
|
||||||
|
working-directory: ${{ inputs.doc_directory }}/_build/html
|
||||||
|
path: '*'
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
Sphinx-LaTeX:
|
||||||
|
name: 📓 LaTeX Documentation using Sphinx and Python ${{ inputs.python_version }}
|
||||||
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⏬ Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- 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
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
|
if: inputs.unittest_xml_artifact != ''
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.unittest_xml_artifact }}
|
||||||
|
path: ${{ inputs.unittest_xml_directory }}
|
||||||
|
investigate: true
|
||||||
|
|
||||||
|
- name: 📥 Download artifacts '${{ inputs.coverage_json_artifact }}' from 'PublishCoverageResults' job
|
||||||
|
uses: pyTooling/download-artifact@v5
|
||||||
|
if: inputs.coverage_json_artifact != ''
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.coverage_json_artifact }}
|
||||||
|
path: ${{ inputs.coverage_report_json_directory }}
|
||||||
|
investigate: true
|
||||||
|
|
||||||
- name: ☑ Generate LaTeX documentation
|
- name: ☑ Generate LaTeX documentation
|
||||||
if: inputs.latex_artifact != ''
|
if: inputs.latex_artifact != ''
|
||||||
# continue-on-error: true
|
# continue-on-error: true
|
||||||
@@ -182,22 +184,95 @@ jobs:
|
|||||||
sphinx-build -v -n -b latex -d _build/doctrees -j $(nproc) -w _build/latex.log . _build/latex
|
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
|
# --builder html --doctree-dir _build/doctrees --verbose --fresh-env --write-all --nitpicky --warning-file _build/html.log . _build/html
|
||||||
|
|
||||||
- name: 📤 Upload 'HTML Documentation' artifact
|
- name: Workaround I - https://github.com/sphinx-doc/sphinx/issues/13190
|
||||||
if: inputs.html_artifact != ''
|
if: inputs.latex_artifact != ''
|
||||||
continue-on-error: true
|
run: |
|
||||||
uses: actions/upload-artifact@v4
|
printf "Changing directory to '${{ inputs.doc_directory || '.' }}/_build/latex' ...\n"
|
||||||
with:
|
cd ${{ inputs.doc_directory || '.' }}/_build/latex
|
||||||
name: ${{ inputs.html_artifact }}
|
|
||||||
path: ${{ inputs.doc_directory }}/_build/html
|
MIMETYPE_EXTENSIONS=(
|
||||||
if-no-files-found: error
|
"image/png:png"
|
||||||
retention-days: 1
|
"image/jpeg:jpg"
|
||||||
|
"image/svg+xml:svg"
|
||||||
|
)
|
||||||
|
|
||||||
|
printf "Changing file extension according to MIME type ...\n"
|
||||||
|
while IFS=$'\n' read -r file; do
|
||||||
|
printf " Checking '%s' ... " "${file}"
|
||||||
|
mime="$(file --mime-type -b "${file}")"
|
||||||
|
printf "[%s]\n" "${mime}"
|
||||||
|
|
||||||
|
found=0
|
||||||
|
for MIME in "${MIMETYPE_EXTENSIONS[@]}"; do
|
||||||
|
mimetype="${MIME%%:*}"
|
||||||
|
extension="${MIME#*:}"
|
||||||
|
|
||||||
|
if [[ "${mime}" == "${mimetype}" && "${file##*.}" != "${extension}" ]]; then
|
||||||
|
printf " Rename file to '%s' " "${file}.${extension}"
|
||||||
|
mv "${file}" "${file}.${extension}"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "[OK]\n"
|
||||||
|
else
|
||||||
|
printf "[FAILED]\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf " Patching LaTeX file for '%s' " "${file}"
|
||||||
|
sed -i "s:{{${file%.*}}\.${file##*.}}:{{${file}}.${extension}}:g" *.tex
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "[OK]\n"
|
||||||
|
else
|
||||||
|
printf "[FAILED]\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
found=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ $found -eq 0 ]]; then
|
||||||
|
printf "[SKIPPED]\n"
|
||||||
|
fi
|
||||||
|
done < <(find . -type f -not -iname "*.cls" -not -iname "*.sty" -not -iname "*.xdy" -not -iname "*.svg" -not -iname "*.png" -not -iname "*.jpg" | sed 's:./::')
|
||||||
|
|
||||||
|
- name: Workaround II - https://github.com/sphinx-doc/sphinx/issues/13189
|
||||||
|
if: inputs.latex_artifact != ''
|
||||||
|
run: |
|
||||||
|
printf "Changing directory to '${{ inputs.doc_directory || '.' }}/_build/latex' ...\n"
|
||||||
|
cd ${{ inputs.doc_directory || '.' }}/_build/latex
|
||||||
|
|
||||||
|
printf "Searching for downloaded images, that need normalization ...\n"
|
||||||
|
for imageExt in png svg jpg jpeg; do
|
||||||
|
printf " Processing '%s' ...\n" "${imageExt}"
|
||||||
|
while IFS=$'\n' read -r imageFile; do
|
||||||
|
newFile="${imageFile//%/_}";
|
||||||
|
|
||||||
|
printf " %s\n" "$imageFile";
|
||||||
|
if [[ "${imageFile}" != "${newFile}" ]]; then
|
||||||
|
printf " Rename file to '%s' " "${newFile}"
|
||||||
|
mv "${imageFile}" "${newFile}"
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "[OK]\n"
|
||||||
|
else
|
||||||
|
printf "[FAILED]\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf " Patching LaTeX file for '%s' " "${newFile}"
|
||||||
|
sed -i "s:{{${imageFile%.*}}\.${imageFile##*.}}:{{${newFile%.*}}.${newFile##*.}}:g" *.tex
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf "[OK]\n"
|
||||||
|
else
|
||||||
|
printf "[FAILED]\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done < <(find . -type f -iname "*.$imageExt" | sed 's:./::')
|
||||||
|
done
|
||||||
|
|
||||||
- name: 📤 Upload 'LaTeX Documentation' artifact
|
- name: 📤 Upload 'LaTeX Documentation' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.latex_artifact != ''
|
if: inputs.latex_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.latex_artifact }}
|
name: ${{ inputs.latex_artifact }}
|
||||||
path: ${{ inputs.doc_directory }}/_build/latex
|
working-directory: ${{ inputs.doc_directory }}/_build/latex
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
20
.github/workflows/StaticTypeCheck.yml
vendored
20
.github/workflows/StaticTypeCheck.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,10 +25,15 @@ name: Static Type Check
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip.'
|
description: 'Python dependencies to be installed through pip.'
|
||||||
@@ -63,11 +68,11 @@ jobs:
|
|||||||
|
|
||||||
StaticTypeCheck:
|
StaticTypeCheck:
|
||||||
name: 👀 Check Static Typing using Python ${{ inputs.python_version }}
|
name: 👀 Check Static Typing using Python ${{ inputs.python_version }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -82,19 +87,20 @@ jobs:
|
|||||||
run: ${{ inputs.commands }}
|
run: ${{ inputs.commands }}
|
||||||
|
|
||||||
- name: 📤 Upload 'Static Typing Report' HTML artifact
|
- name: 📤 Upload 'Static Typing Report' HTML artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: ${{ inputs.html_artifact != '' }}
|
if: ${{ inputs.html_artifact != '' }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.html_artifact }}
|
name: ${{ inputs.html_artifact }}
|
||||||
path: ${{ inputs.html_report }}
|
working-directory: ${{ inputs.html_report }}
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Static Typing Report' JUnit artifact
|
- name: 📤 Upload 'Static Typing Report' JUnit artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: ${{ inputs.junit_artifact != '' }}
|
if: ${{ inputs.junit_artifact != '' }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.junit_artifact }}
|
name: ${{ inputs.junit_artifact }}
|
||||||
path: ${{ inputs.junit_report }}
|
path: ${{ inputs.junit_report }}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -20,47 +20,65 @@
|
|||||||
# #
|
# #
|
||||||
# SPDX-License-Identifier: Apache-2.0 #
|
# SPDX-License-Identifier: Apache-2.0 #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
name: Release
|
name: Auto Tag
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ubuntu_image:
|
||||||
|
description: 'Name of the Ubuntu image.'
|
||||||
|
required: false
|
||||||
|
default: 'ubuntu-24.04'
|
||||||
|
type: string
|
||||||
|
version:
|
||||||
|
description: 'Version used as tag name.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
auto_tag:
|
||||||
|
description: 'Automatically add and push a tag.'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
workflow:
|
||||||
|
description: 'Workflow to start after adding a tag.'
|
||||||
|
required: false
|
||||||
|
default: 'Pipeline.yml'
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
AutoTag:
|
||||||
|
name: "🏷 Create tag '${{ inputs.version}}' on GitHub"
|
||||||
|
runs-on: ${{ inputs.ubuntu_image }}
|
||||||
|
if: inputs.auto_tag == 'true'
|
||||||
|
|
||||||
Release:
|
# if: github.ref == 'refs/heads/${{ inputs.release_branch }}'
|
||||||
name: 📝 Create 'Release Page' on GitHub
|
|
||||||
runs-on: ubuntu-latest
|
permissions:
|
||||||
|
contents: write # required for tag creation
|
||||||
|
actions: write # required to start a new pipeline
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 🔁 Extract Git tag from GITHUB_REF
|
- name: 🏷 Create release tag '${{ steps.FindPullRequest.outputs.version }}'
|
||||||
id: getVariables
|
uses: actions/github-script@v7
|
||||||
run: |
|
id: createReleaseTag
|
||||||
GIT_TAG=${GITHUB_REF#refs/*/}
|
# if: inputs.auto_tag == 'true'
|
||||||
RELEASE_VERSION=${GIT_TAG#v}
|
|
||||||
RELEASE_DATETIME="$(date --utc '+%d.%m.%Y - %H:%M:%S')"
|
|
||||||
# write to step outputs
|
|
||||||
echo "gitTag=${GIT_TAG}" >> $GITHUB_OUTPUT
|
|
||||||
echo "version=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
echo "datetime=${RELEASE_DATETIME}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 📑 Create Release Page
|
|
||||||
id: createReleasePage
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.getVariables.outputs.gitTag }}
|
script: |
|
||||||
# release_name: ${{ steps.getVariables.outputs.gitTag }}
|
github.rest.git.createRef({
|
||||||
body: |
|
owner: context.repo.owner,
|
||||||
**Automated Release created on: ${{ steps.getVariables.outputs.datetime }}**
|
repo: context.repo.repo,
|
||||||
|
ref: 'refs/tags/${{ inputs.version }}',
|
||||||
|
sha: context.sha
|
||||||
|
})
|
||||||
|
|
||||||
# New Features
|
- name: Trigger Workflow
|
||||||
* tbd
|
uses: actions/github-script@v7
|
||||||
|
id: runReleaseTag
|
||||||
# Changes
|
# if: inputs.auto_tag == 'true'
|
||||||
* tbd
|
with:
|
||||||
|
script: |
|
||||||
# Bug Fixes
|
github.rest.actions.createWorkflowDispatch({
|
||||||
* tbd
|
owner: context.repo.owner,
|
||||||
draft: false
|
repo: context.repo.repo,
|
||||||
prerelease: false
|
workflow_id: '${{ inputs.workflow }}',
|
||||||
|
ref: '${{ inputs.version }}'
|
||||||
|
})
|
||||||
34
.github/workflows/TestReleaser.yml
vendored
34
.github/workflows/TestReleaser.yml
vendored
@@ -3,7 +3,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -41,11 +41,11 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
Image:
|
Image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
env:
|
env:
|
||||||
DOCKER_BUILDKIT: 1
|
DOCKER_BUILDKIT: 1
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Build container image
|
- name: Build container image
|
||||||
run: docker build -t ghcr.io/pytooling/releaser -f releaser/Dockerfile releaser
|
run: docker build -t ghcr.io/pytooling/releaser -f releaser/Dockerfile releaser
|
||||||
@@ -60,11 +60,11 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
Composite:
|
Composite:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
- run: printf "%s\n" "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||||
|
|
||||||
- name: Single
|
- name: Single
|
||||||
uses: ./releaser/composite
|
uses: ./releaser/composite
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
- name: Add artifacts/*.txt
|
- name: Add artifacts/*.txt
|
||||||
run: |
|
run: |
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
printf "%s\n" "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
||||||
touch artifacts/empty_file.txt
|
touch artifacts/empty_file.txt
|
||||||
|
|
||||||
- name: Single in subdir
|
- name: Single in subdir
|
||||||
@@ -95,8 +95,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Add artifacts/*.md
|
- name: Add artifacts/*.md
|
||||||
run: |
|
run: |
|
||||||
echo "releaser hello" > artifacts/hello.md
|
printf "%s\n" "releaser hello" > artifacts/hello.md
|
||||||
echo "releaser world" > artifacts/world.md
|
printf "%s\n" "releaser world" > artifacts/world.md
|
||||||
|
|
||||||
- name: Directory wildcard
|
- name: Directory wildcard
|
||||||
uses: ./releaser/composite
|
uses: ./releaser/composite
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
- name: Add artifacts/subdir
|
- name: Add artifacts/subdir
|
||||||
run: |
|
run: |
|
||||||
mkdir artifacts/subdir
|
mkdir artifacts/subdir
|
||||||
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
printf "%s\n" "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||||
|
|
||||||
- name: Directory wildcard (recursive)
|
- name: Directory wildcard (recursive)
|
||||||
uses: ./releaser/composite
|
uses: ./releaser/composite
|
||||||
@@ -120,11 +120,11 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- Image
|
- Image
|
||||||
- Composite
|
- Composite
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
- run: printf "%s\n" "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||||
|
|
||||||
- name: Single
|
- name: Single
|
||||||
uses: ./releaser
|
uses: ./releaser
|
||||||
@@ -144,7 +144,7 @@ jobs:
|
|||||||
- name: Add artifacts/*.txt
|
- name: Add artifacts/*.txt
|
||||||
run: |
|
run: |
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
printf "%s\n" "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
||||||
touch artifacts/empty_file.txt
|
touch artifacts/empty_file.txt
|
||||||
|
|
||||||
- name: Single in subdir
|
- name: Single in subdir
|
||||||
@@ -155,8 +155,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Add artifacts/*.md
|
- name: Add artifacts/*.md
|
||||||
run: |
|
run: |
|
||||||
echo "releaser hello" > artifacts/hello.md
|
printf "%s\n" "releaser hello" > artifacts/hello.md
|
||||||
echo "releaser world" > artifacts/world.md
|
printf "%s\n" "releaser world" > artifacts/world.md
|
||||||
|
|
||||||
- name: Directory wildcard
|
- name: Directory wildcard
|
||||||
uses: ./releaser
|
uses: ./releaser
|
||||||
@@ -167,7 +167,7 @@ jobs:
|
|||||||
- name: Add artifacts/subdir
|
- name: Add artifacts/subdir
|
||||||
run: |
|
run: |
|
||||||
mkdir artifacts/subdir
|
mkdir artifacts/subdir
|
||||||
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
printf "%s\n" "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||||
|
|
||||||
- name: Directory wildcard (recursive)
|
- name: Directory wildcard (recursive)
|
||||||
uses: ./releaser
|
uses: ./releaser
|
||||||
|
|||||||
263
.github/workflows/UnitTesting.yml
vendored
263
.github/workflows/UnitTesting.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -29,21 +29,56 @@ on:
|
|||||||
description: 'JSON list with environment fields, telling the system and Python versions to run tests with.'
|
description: 'JSON list with environment fields, telling the system and Python versions to run tests with.'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
apt:
|
||||||
|
description: 'Ubuntu dependencies to be installed through apt.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
brew:
|
||||||
|
description: 'macOS dependencies to be installed through brew.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
pacboy:
|
||||||
|
description: 'MSYS2 dependencies to be installed through pacboy (pacman).'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip.'
|
description: 'Python dependencies to be installed through pip.'
|
||||||
required: false
|
required: false
|
||||||
default: '-r tests/requirements.txt'
|
default: '-r tests/requirements.txt'
|
||||||
type: string
|
type: string
|
||||||
pacboy:
|
|
||||||
description: 'MSYS2 dependencies to be installed through pacboy (pacman).'
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
type: string
|
|
||||||
mingw_requirements:
|
mingw_requirements:
|
||||||
description: 'Override Python dependencies to be installed through pip on MSYS2 (MINGW64) only.'
|
description: 'Override Python dependencies to be installed through pip on MSYS2 (MINGW64) only.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
macos_before_script:
|
||||||
|
description: 'Scripts to execute before pytest on macOS (Intel).'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
macos_arm_before_script:
|
||||||
|
description: 'Scripts to execute before pytest on macOS (ARM).'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
ubuntu_before_script:
|
||||||
|
description: 'Scripts to execute before pytest on Ubuntu.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
mingw64_before_script:
|
||||||
|
description: 'Scripts to execute before pytest on Windows within MSYS2 MinGW64.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
ucrt64_before_script:
|
||||||
|
description: 'Scripts to execute before pytest on Windows within MSYS2 UCRT64.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
root_directory:
|
root_directory:
|
||||||
description: 'Working directory for running tests.'
|
description: 'Working directory for running tests.'
|
||||||
required: false
|
required: false
|
||||||
@@ -59,11 +94,26 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: 'unit'
|
default: 'unit'
|
||||||
type: string
|
type: string
|
||||||
|
unittest_report_xml_directory:
|
||||||
|
description: 'Path where to save the unittest summary report XML.'
|
||||||
|
required: false
|
||||||
|
default: 'report/unit'
|
||||||
|
type: string
|
||||||
|
unittest_report_xml_filename:
|
||||||
|
description: 'Filename of the unittest summary report XML.'
|
||||||
|
required: false
|
||||||
|
default: 'TestReportSummary.xml'
|
||||||
|
type: string
|
||||||
coverage_config:
|
coverage_config:
|
||||||
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
description: 'Path to the .coveragerc file. Use pyproject.toml by default.'
|
||||||
required: false
|
required: false
|
||||||
default: 'pyproject.toml'
|
default: 'pyproject.toml'
|
||||||
type: string
|
type: string
|
||||||
|
coverage_report_html_directory:
|
||||||
|
description: ''
|
||||||
|
required: false
|
||||||
|
default: 'report/coverage/html'
|
||||||
|
type: string
|
||||||
unittest_xml_artifact:
|
unittest_xml_artifact:
|
||||||
description: "Generate unit test report with junitxml and upload results as an artifact."
|
description: "Generate unit test report with junitxml and upload results as an artifact."
|
||||||
required: false
|
required: false
|
||||||
@@ -111,7 +161,23 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
# Package Manager steps
|
||||||
|
- name: 🔧 Install homebrew dependencies on macOS
|
||||||
|
if: ( matrix.system == 'macos' || matrix.system == 'macos-arm' ) && inputs.brew != ''
|
||||||
|
run: brew install ${{ inputs.brew }}
|
||||||
|
|
||||||
|
- name: 🔧 Install apt dependencies on Ubuntu
|
||||||
|
if: matrix.system == 'ubuntu' && inputs.apt != ''
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends ${{ inputs.apt }}
|
||||||
|
|
||||||
|
# Compute Dependencies for MSYS2 steps
|
||||||
|
|
||||||
- name: 🔧 Install dependencies (system Python for Python shell)
|
- name: 🔧 Install dependencies (system Python for Python shell)
|
||||||
if: matrix.system == 'msys2'
|
if: matrix.system == 'msys2'
|
||||||
@@ -149,27 +215,37 @@ jobs:
|
|||||||
requirements = "${{ inputs.requirements }}"
|
requirements = "${{ inputs.requirements }}"
|
||||||
if requirements.startswith("-r"):
|
if requirements.startswith("-r"):
|
||||||
requirementsFile = Path(requirements[2:].lstrip())
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
dependencies = loadRequirementsFile(requirementsFile)
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFoundError::{ex}")
|
||||||
|
exit(1)
|
||||||
else:
|
else:
|
||||||
dependencies = [req.strip() for req in requirements.split(" ")]
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
"coverage": "python-coverage:p",
|
"coverage": "python-coverage:p",
|
||||||
"igraph": "igraph:p",
|
"docstr_coverage": "python-pyaml:p python-types-pyyaml:p",
|
||||||
"jinja2": "python-markupsafe:p",
|
"igraph": "igraph:p",
|
||||||
"lxml": "python-lxml:p",
|
"jinja2": "python-markupsafe:p",
|
||||||
"numpy": "python-numpy:p",
|
"lxml": "python-lxml:p",
|
||||||
"markupsafe": "python-markupsafe:p",
|
"numpy": "python-numpy:p",
|
||||||
"pip": "python-pip:p",
|
"markupsafe": "python-markupsafe:p",
|
||||||
"ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
"pip": "python-pip:p",
|
||||||
"sphinx": "python-markupsafe:p",
|
"pyyaml": "python-pyyaml:p python-types-pyyaml:p",
|
||||||
"tomli": "python-tomli:p",
|
"ruamel.yaml": "python-ruamel-yaml:p",
|
||||||
"wheel": "python-wheel:p",
|
# "ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
|
"sphinx": "python-markupsafe:p",
|
||||||
|
"tomli": "python-tomli:p",
|
||||||
|
"wheel": "python-wheel:p",
|
||||||
|
"pyedaa.projectmodel": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
"pyedaa.reports": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
"sphinx-reports": "python-markupsafe:p python-pyaml:p python-types-pyyaml:p",
|
||||||
}
|
}
|
||||||
subPackages = {
|
subPackages = {
|
||||||
"pytooling": {
|
"pytooling": {
|
||||||
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
regExp = compile(r"(?P<PackageName>[\w_\-\.]+)(?:\[(?P<SubPackages>(?:\w+)(?:\s*,\s*\w+)*)\])?(?:\s*(?P<Comperator>[<>~=]+)\s*)(?P<Version>\d+(?:\.\d+)*)(?:-(?P<VersionExtension>\w+))?")
|
regExp = compile(r"(?P<PackageName>[\w_\-\.]+)(?:\[(?P<SubPackages>(?:\w+)(?:\s*,\s*\w+)*)\])?(?:\s*(?P<Comperator>[<>~=]+)\s*)(?P<Version>\d+(?:\.\d+)*)(?:-(?P<VersionExtension>\w+))?")
|
||||||
@@ -204,9 +280,11 @@ jobs:
|
|||||||
with github_output.open("a+") as f:
|
with github_output.open("a+") as f:
|
||||||
f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
f.write(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
||||||
|
|
||||||
|
# Python setup
|
||||||
|
|
||||||
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
|
- name: '🟦 Setup MSYS2 for ${{ matrix.runtime }}'
|
||||||
if: matrix.system == 'msys2'
|
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
|
if: matrix.system == 'msys2'
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.runtime }}
|
msystem: ${{ matrix.runtime }}
|
||||||
update: true
|
update: true
|
||||||
@@ -215,11 +293,13 @@ jobs:
|
|||||||
${{ inputs.pacboy }}
|
${{ inputs.pacboy }}
|
||||||
|
|
||||||
- name: 🐍 Setup Python ${{ matrix.python }}
|
- name: 🐍 Setup Python ${{ matrix.python }}
|
||||||
if: matrix.system != 'msys2'
|
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
if: matrix.system != 'msys2'
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
# Python Dependency steps
|
||||||
|
|
||||||
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
- name: 🔧 Install wheel,tomli and pip dependencies (native)
|
||||||
if: matrix.system != 'msys2'
|
if: matrix.system != 'msys2'
|
||||||
run: |
|
run: |
|
||||||
@@ -235,87 +315,60 @@ jobs:
|
|||||||
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
|
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 🔁 Extract configurations from pyproject.toml
|
# Before scripts
|
||||||
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}")
|
- name: 🍎 macOS (Intel) before scripts
|
||||||
|
if: matrix.system == 'macos' && inputs.macos_before_script != ''
|
||||||
|
run: ${{ inputs.macos_before_script }}
|
||||||
|
|
||||||
from tomli import load as tomli_load
|
- name: 🍏 macOS (ARM) before scripts
|
||||||
|
if: matrix.system == 'macos-arm' && inputs.macos_arm_before_script != ''
|
||||||
|
run: ${{ inputs.macos_arm_before_script }}
|
||||||
|
|
||||||
htmlDirectory = Path("htmlcov")
|
- name: 🐧 Ubuntu before scripts
|
||||||
xmlFile = Path("./coverage.xml")
|
if: matrix.system == 'ubuntu' && inputs.ubuntu_before_script != ''
|
||||||
jsonFile = Path("./coverage.json")
|
run: ${{ inputs.ubuntu_before_script }}
|
||||||
coverageRC = "${{ inputs.coverage_config }}".strip()
|
|
||||||
|
|
||||||
# Read output paths from 'pyproject.toml' file
|
# Windows before script
|
||||||
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"])
|
- name: 🪟🟦 MinGW64 before scripts
|
||||||
xmlFile = Path(pyProjectSettings["tool"]["coverage"]["xml"]["output"])
|
if: matrix.system == 'msys2' && matrix.runtime == 'MINGW64' && inputs.mingw64_before_script != ''
|
||||||
jsonFile = Path(pyProjectSettings["tool"]["coverage"]["json"]["output"])
|
run: ${{ inputs.mingw64_before_script }}
|
||||||
else:
|
|
||||||
print(f"File '{pyProjectFile}' not found and no '.coveragerc' file specified.")
|
|
||||||
|
|
||||||
# Read output paths from '.coveragerc' file
|
- name: 🪟🟨 UCRT64 before scripts
|
||||||
elif len(coverageRC) > 0:
|
if: matrix.system == 'msys2' && matrix.runtime == 'UCRT64' && inputs.ucrt64_before_script != ''
|
||||||
coverageRCFile = Path(coverageRC)
|
run: ${{ inputs.ucrt64_before_script }}
|
||||||
if coverageRCFile.exists():
|
|
||||||
with coverageRCFile.open("rb") as file:
|
|
||||||
coverageRCSettings = tomli_load(file)
|
|
||||||
|
|
||||||
htmlDirectory = Path(coverageRCSettings["html"]["directory"])
|
# Run pytests
|
||||||
xmlFile = Path(coverageRCSettings["xml"]["output"])
|
|
||||||
jsonFile = Path(coverageRCSettings["json"]["output"])
|
|
||||||
else:
|
|
||||||
print(f"File '{coverageRCFile}' not found.")
|
|
||||||
|
|
||||||
# Write jobs to special file
|
- name: ✅ Run unit tests (Ubuntu/macOS)
|
||||||
github_output = Path(getenv("GITHUB_OUTPUT"))
|
id: pytest_bash
|
||||||
print(f"GITHUB_OUTPUT: {github_output}")
|
|
||||||
with github_output.open("a+", encoding="utf-8") as f:
|
|
||||||
f.write(dedent(f"""\
|
|
||||||
unittest_report_html_directory={htmlDirectory}
|
|
||||||
coverage_report_html_directory={htmlDirectory.as_posix()}
|
|
||||||
coverage_report_xml={xmlFile}
|
|
||||||
coverage_report_json={jsonFile}
|
|
||||||
"""))
|
|
||||||
|
|
||||||
print(f"DEBUG:\n html={htmlDirectory}\n xml={xmlFile}\n json={jsonFile}")
|
|
||||||
|
|
||||||
- name: ☑ Run unit tests (Ubuntu/macOS)
|
|
||||||
if: matrix.system != 'windows'
|
if: matrix.system != 'windows'
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
||||||
export PYTHONPATH=$(pwd)
|
export PYTHONPATH=$(pwd)
|
||||||
|
|
||||||
cd "${{ inputs.root_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
[ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
[ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=${{ inputs.unittest_report_xml_directory }}/${{ inputs.unittest_report_xml_filename }}' || unset PYTEST_ARGS
|
||||||
if [ -n '${{ inputs.coverage_config }}' ]; then
|
if [ -n '${{ inputs.coverage_config }}' ]; then
|
||||||
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
printf "%s\n" "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
||||||
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
||||||
else
|
else
|
||||||
echo "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
printf "%s\n" "python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
||||||
python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
python -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: ☑ Run unit tests (Windows)
|
- name: ✅ Run unit tests (Windows)
|
||||||
|
id: pytest_posh
|
||||||
if: matrix.system == 'windows'
|
if: matrix.system == 'windows'
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
||||||
$env:PYTHONPATH = (Get-Location).ToString()
|
$env:PYTHONPATH = (Get-Location).ToString()
|
||||||
|
|
||||||
cd "${{ inputs.root_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
$PYTEST_ARGS = if ("${{ inputs.unittest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" }
|
$PYTEST_ARGS = if ("${{ inputs.unittest_xml_artifact }}") { "--junitxml=${{ inputs.unittest_report_xml_directory }}/${{ inputs.unittest_report_xml_filename }}" } else { "" }
|
||||||
if ("${{ inputs.coverage_config }}") {
|
if ("${{ inputs.coverage_config }}") {
|
||||||
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
||||||
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}
|
||||||
@@ -325,32 +378,42 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
- name: Convert coverage to XML format (Cobertura)
|
- name: Convert coverage to XML format (Cobertura)
|
||||||
|
id: convert_xml
|
||||||
if: inputs.coverage_xml_artifact != ''
|
if: inputs.coverage_xml_artifact != ''
|
||||||
|
continue-on-error: true
|
||||||
run: coverage xml --data-file=.coverage
|
run: coverage xml --data-file=.coverage
|
||||||
|
|
||||||
- name: Convert coverage to JSON format
|
- name: Convert coverage to JSON format
|
||||||
|
id: convert_json
|
||||||
if: inputs.coverage_json_artifact != ''
|
if: inputs.coverage_json_artifact != ''
|
||||||
|
continue-on-error: true
|
||||||
run: coverage json --data-file=.coverage
|
run: coverage json --data-file=.coverage
|
||||||
|
|
||||||
- name: Convert coverage to HTML format
|
- name: Convert coverage to HTML format
|
||||||
|
id: convert_html
|
||||||
if: inputs.coverage_html_artifact != ''
|
if: inputs.coverage_html_artifact != ''
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
coverage html --data-file=.coverage -d ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
coverage html --data-file=.coverage -d ${{ inputs.coverage_report_html_directory }}
|
||||||
rm ${{ steps.getVariables.outputs.coverage_report_html_directory }}/.gitignore
|
rm ${{ inputs.coverage_report_html_directory }}/.gitignore
|
||||||
|
|
||||||
- name: 📤 Upload 'TestReportSummary.xml' artifact
|
# Upload artifacts
|
||||||
|
|
||||||
|
- name: 📤 Upload '${{ inputs.unittest_report_xml_filename }}' artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
if: inputs.unittest_xml_artifact != ''
|
if: inputs.unittest_xml_artifact != ''
|
||||||
uses: actions/upload-artifact@v4
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.unittest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.unittest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: report/unit/TestReportSummary.xml
|
working-directory: ${{ inputs.unittest_report_xml_directory }}
|
||||||
|
path: ${{ inputs.unittest_report_xml_filename }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
# - name: 📤 Upload 'Unit Tests HTML Report' artifact
|
# - name: 📤 Upload 'Unit Tests HTML Report' artifact
|
||||||
# if: inputs.unittest_html_artifact != ''
|
# if: inputs.unittest_html_artifact != ''
|
||||||
# continue-on-error: true
|
# continue-on-error: true
|
||||||
# uses: actions/upload-artifact@v4
|
# uses: pyTooling/upload-artifact@v4
|
||||||
# with:
|
# with:
|
||||||
# name: ${{ inputs.unittest_html_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
# name: ${{ inputs.unittest_html_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
# path: ${{ steps.getVariables.outputs.unittest_report_html_directory }}
|
# path: ${{ steps.getVariables.outputs.unittest_report_html_directory }}
|
||||||
@@ -360,17 +423,18 @@ jobs:
|
|||||||
- name: 📤 Upload 'Coverage SQLite Database' artifact
|
- name: 📤 Upload 'Coverage SQLite Database' artifact
|
||||||
if: inputs.coverage_sqlite_artifact != ''
|
if: inputs.coverage_sqlite_artifact != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_sqlite_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.coverage_sqlite_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: .coverage
|
path: .coverage
|
||||||
|
include-hidden-files: true
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage XML Report' artifact
|
- name: 📤 Upload 'Coverage XML Report' artifact
|
||||||
if: inputs.coverage_xml_artifact != ''
|
if: inputs.coverage_xml_artifact != '' && steps.convert_xml.outcome == 'success'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.coverage_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
path: ${{ steps.getVariables.outputs.coverage_report_xml }}
|
||||||
@@ -378,9 +442,9 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage JSON Report' artifact
|
- name: 📤 Upload 'Coverage JSON Report' artifact
|
||||||
if: inputs.coverage_json_artifact != ''
|
if: inputs.coverage_json_artifact != '' && steps.convert_json.outcome == 'success'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_json_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.coverage_json_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_json }}
|
path: ${{ steps.getVariables.outputs.coverage_report_json }}
|
||||||
@@ -388,11 +452,26 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: 📤 Upload 'Coverage HTML Report' artifact
|
- name: 📤 Upload 'Coverage HTML Report' artifact
|
||||||
if: inputs.coverage_html_artifact != ''
|
if: inputs.coverage_html_artifact != '' && steps.convert_html.outcome == 'success'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.coverage_html_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
name: ${{ inputs.coverage_html_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
working-directory: ${{ steps.getVariables.outputs.coverage_report_html_directory }}
|
||||||
|
path: '*'
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Generate error messages
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
exitCode=0
|
||||||
|
if [[ "${{ steps.pytest_bash.outcome }}" == "failure" || "${{ steps.pytest_posh.outcome }}" == "failure" ]]; then
|
||||||
|
printf "❌ pytest: %s\n" "Error in pytest execution."
|
||||||
|
printf "::error title=%s::%s\n" "pytest" "Error in pytest execution."
|
||||||
|
exitCode=1
|
||||||
|
else
|
||||||
|
printf "✅ pytest: No errors.\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $exitCode
|
||||||
|
|||||||
15
.github/workflows/VerifyDocs.yml
vendored
15
.github/workflows/VerifyDocs.yml
vendored
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -25,21 +25,26 @@ name: Verify examples
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
ubuntu_image_version:
|
||||||
|
description: 'Ubuntu image version.'
|
||||||
|
required: false
|
||||||
|
default: '24.04'
|
||||||
|
type: string
|
||||||
python_version:
|
python_version:
|
||||||
description: 'Python version.'
|
description: 'Python version.'
|
||||||
required: false
|
required: false
|
||||||
default: '3.12'
|
default: '3.13'
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
VerifyDocs:
|
VerifyDocs:
|
||||||
name: 👍 Verify example snippets using Python ${{ inputs.python_version }}
|
name: 👍 Verify example snippets using Python ${{ inputs.python_version }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: ⏬ Checkout repository
|
- name: ⏬ Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 🐍 Setup Python
|
- name: 🐍 Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
@@ -72,7 +77,7 @@ jobs:
|
|||||||
- name: Print example.py
|
- name: Print example.py
|
||||||
run: cat tests/docs/example.py
|
run: cat tests/docs/example.py
|
||||||
|
|
||||||
- name: ☑ Run example snippet
|
- name: ✅ Run example snippet
|
||||||
working-directory: tests/docs
|
working-directory: tests/docs
|
||||||
run: |
|
run: |
|
||||||
python3 example.py
|
python3 example.py
|
||||||
|
|||||||
16
.github/workflows/_Checking_ArtifactCleanup.yml
vendored
16
.github/workflows/_Checking_ArtifactCleanup.yml
vendored
@@ -6,10 +6,10 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Params:
|
Params:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.10 3.11"
|
python_version_list: "3.12 3.13"
|
||||||
system_list: "ubuntu windows"
|
system_list: "ubuntu windows"
|
||||||
|
|
||||||
Testing:
|
Testing:
|
||||||
@@ -22,10 +22,10 @@ jobs:
|
|||||||
include: ${{ fromJson(needs.Params.outputs.python_jobs) }}
|
include: ${{ fromJson(needs.Params.outputs.python_jobs) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Content creation for ${{ matrix.system }}-${{ matrix.python }}
|
- name: Content creation for ${{ matrix.system }}-${{ matrix.python }}
|
||||||
run: echo "${{ matrix.runs-on }}-${{ matrix.python }}" >> artifact.txt
|
run: printf "%s\n" "${{ matrix.runs-on }}-${{ matrix.python }}" >> artifact.txt
|
||||||
|
|
||||||
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-${{ matrix.system }}-${{ matrix.python }}
|
name: ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-${{ matrix.system }}-${{ matrix.python }}
|
||||||
path: artifact.txt
|
path: artifact.txt
|
||||||
@@ -36,13 +36,13 @@ jobs:
|
|||||||
name: Package generation
|
name: Package generation
|
||||||
needs:
|
needs:
|
||||||
- Params
|
- Params
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Package creation
|
- name: Package creation
|
||||||
run: echo "Package" >> package.txt
|
run: printf "%s\n" "Package" >> package.txt
|
||||||
|
|
||||||
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
- name: 📤 Upload artifact for ${{ matrix.system }}-${{ matrix.python }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: pyTooling/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
name: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
||||||
path: package.txt
|
path: package.txt
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
ArtifactCleanUp:
|
ArtifactCleanUp:
|
||||||
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1
|
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
|
||||||
needs:
|
needs:
|
||||||
- Params
|
- Params
|
||||||
- Testing
|
- Testing
|
||||||
|
|||||||
293
.github/workflows/_Checking_JobTemplates.yml
vendored
Normal file
293
.github/workflows/_Checking_JobTemplates.yml
vendored
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
name: Verification of Job Templates
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Prepare:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@main
|
||||||
|
|
||||||
|
ConfigParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@main
|
||||||
|
with:
|
||||||
|
package_name: pyDummy
|
||||||
|
|
||||||
|
InstallParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
|
with:
|
||||||
|
package_name: pyDummy
|
||||||
|
python_version_list: ''
|
||||||
|
|
||||||
|
UnitTestingParams:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
|
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@main
|
||||||
|
with:
|
||||||
|
name: Platform
|
||||||
|
python_version_list: ""
|
||||||
|
system_list: "ubuntu windows macos mingw64 clang64 ucrt64"
|
||||||
|
|
||||||
|
UnitTesting:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
with:
|
||||||
|
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
|
||||||
|
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 }}
|
||||||
|
unittest_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
|
||||||
|
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
||||||
|
# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
||||||
|
# coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
||||||
|
# coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
||||||
|
|
||||||
|
PlatformTesting:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- PlatformTestingParams
|
||||||
|
with:
|
||||||
|
jobs: ${{ needs.PlatformTestingParams.outputs.python_jobs }}
|
||||||
|
# tests_directory: ""
|
||||||
|
unittest_directory: platform
|
||||||
|
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.PlatformTestingParams.outputs.artifact_names).unittesting_xml }}
|
||||||
|
unittest_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_html }}
|
||||||
|
coverage_sqlite_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
||||||
|
coverage_xml_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_xml }}
|
||||||
|
coverage_json_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_json }}
|
||||||
|
coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }}
|
||||||
|
|
||||||
|
StaticTypeCheck:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@main
|
||||||
|
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@main
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
# - UnitTesting
|
||||||
|
# - PlatformTesting
|
||||||
|
with:
|
||||||
|
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
|
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
||||||
|
|
||||||
|
Install:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/InstallPackage.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- InstallParams
|
||||||
|
- Package
|
||||||
|
with:
|
||||||
|
jobs: ${{ needs.InstallParams.outputs.python_jobs }}
|
||||||
|
wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
||||||
|
package_name: ${{ needs.ConfigParams.outputs.package_fullname }}
|
||||||
|
|
||||||
|
PublishCoverageResults:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
- PlatformTesting
|
||||||
|
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: true
|
||||||
|
codacy: true
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
PublishTestResults:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@main
|
||||||
|
needs:
|
||||||
|
- ConfigParams
|
||||||
|
- UnitTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
- PlatformTesting
|
||||||
|
with:
|
||||||
|
additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform"'
|
||||||
|
testsuite-summary-name: ${{ needs.ConfigParams.outputs.package_fullname }}
|
||||||
|
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
||||||
|
codecov: true
|
||||||
|
dorny: true
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# VerifyDocs:
|
||||||
|
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@main
|
||||||
|
# needs:
|
||||||
|
# - UnitTestingParams
|
||||||
|
# with:
|
||||||
|
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
||||||
|
|
||||||
|
Documentation:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@main
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- PublishCoverageResults
|
||||||
|
- PublishTestResults
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- Documentation
|
||||||
|
with:
|
||||||
|
document: Actions
|
||||||
|
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@main
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- Prepare
|
||||||
|
- UnitTesting
|
||||||
|
- PlatformTesting
|
||||||
|
- Install
|
||||||
|
# - StaticTypeCheck
|
||||||
|
- Package
|
||||||
|
- PublishToGitHubPages
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- Prepare
|
||||||
|
- UnitTesting
|
||||||
|
- PlatformTesting
|
||||||
|
- Install
|
||||||
|
# - 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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- ReleasePage
|
||||||
|
# - Package
|
||||||
|
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@main
|
||||||
|
needs:
|
||||||
|
- UnitTestingParams
|
||||||
|
- PlatformTestingParams
|
||||||
|
- UnitTesting
|
||||||
|
- StaticTypeCheck
|
||||||
|
- PlatformTesting
|
||||||
|
- Documentation
|
||||||
|
- PDFDocumentation
|
||||||
|
- PublishTestResults
|
||||||
|
- PublishCoverageResults
|
||||||
|
- PublishToGitHubPages
|
||||||
|
- IntermediateCleanUp
|
||||||
|
with:
|
||||||
|
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
||||||
|
remaining: |
|
||||||
|
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-*
|
||||||
|
${{ 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.PlatformTestingParams.outputs.artifact_names).unittesting_xml }}-*
|
||||||
|
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_html }}-*
|
||||||
|
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_xml }}-*
|
||||||
|
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_json }}-*
|
||||||
|
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }}-*
|
||||||
19
.github/workflows/_Checking_NamespacePackage_Pipeline.yml
vendored
Normal file
19
.github/workflows/_Checking_NamespacePackage_Pipeline.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Verification of Pipeline Templates (Namespace Package)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
NamespacePackage:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@main
|
||||||
|
with:
|
||||||
|
package_namespace: pyExamples
|
||||||
|
package_name: Extensions
|
||||||
|
codecov: true
|
||||||
|
codacy: true
|
||||||
|
dorny: true
|
||||||
|
secrets:
|
||||||
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }}
|
||||||
121
.github/workflows/_Checking_Nightly.yml
vendored
Normal file
121
.github/workflows/_Checking_Nightly.yml
vendored
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
name: Verification of Nightly Releases
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
name: Build something
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: 🖉 Build 1
|
||||||
|
run: |
|
||||||
|
printf "%s\n" "Document 1 $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt
|
||||||
|
printf "%s\n" "Analysis log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > analysis.log
|
||||||
|
printf "%s\n" "Build log $(date --utc '+%d.%m.%Y - %H:%M:%S')" > build.log
|
||||||
|
|
||||||
|
- name: 📤 Upload artifact
|
||||||
|
uses: pyTooling/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: document
|
||||||
|
path: |
|
||||||
|
document1.txt
|
||||||
|
*.log
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: 🖉 Program
|
||||||
|
run: |
|
||||||
|
printf "%s\n" "Document other $(date --utc '+%d.%m.%Y - %H:%M:%S')" > document1.txt
|
||||||
|
printf "%s\n" "Program $(date --utc '+%d.%m.%Y - %H:%M:%S')" > program.py
|
||||||
|
|
||||||
|
- name: 📤 Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: other
|
||||||
|
path: |
|
||||||
|
*.txt
|
||||||
|
*.py
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
NightlyPage:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/NightlyRelease.yml@main
|
||||||
|
needs:
|
||||||
|
- Build
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
actions: write
|
||||||
|
with:
|
||||||
|
can-fail: true
|
||||||
|
prerelease: true
|
||||||
|
replacements: |
|
||||||
|
version=4.2.0
|
||||||
|
tool=myTool
|
||||||
|
prog=program
|
||||||
|
nightly_title: "Nightly Test Release"
|
||||||
|
nightly_description: |
|
||||||
|
This *nightly* release contains all latest and important artifacts created by %tool%'s CI pipeline.
|
||||||
|
|
||||||
|
# %tool% %version%
|
||||||
|
|
||||||
|
* %prog%
|
||||||
|
assets: |
|
||||||
|
document: document1.txt: Documentation
|
||||||
|
document: build.log: Logfile - %tool% - %tool%
|
||||||
|
other: document1.txt: SBOM - %version%
|
||||||
|
other: %prog%.py: Application - %tool% - %version%
|
||||||
|
document:!archive1.zip: Archive 1 - zip
|
||||||
|
document:!archive2.tgz: Archive 2 - tgz
|
||||||
|
document:!archive3.tar.gz: Archive 3 - tar.gz
|
||||||
|
document:!archive4.tzst: Archive 4 - tzst
|
||||||
|
document:!archive5.tar.zst:Archive 5 - tar.zst
|
||||||
|
document:$archive6.tgz: Archive 6 - tgz + dir
|
||||||
|
document:$archive7.tar.gz: Archive 7 - tar.gz + dir
|
||||||
|
document:$archive8.tzst: Archive 8 - tzst + dir
|
||||||
|
document:$archive9.tar.zst:Archive 9 - tar.zst + dir
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
NightlyPageWithInventory:
|
||||||
|
uses: ./.github/workflows/NightlyRelease.yml
|
||||||
|
needs:
|
||||||
|
- Build
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
actions: write
|
||||||
|
with:
|
||||||
|
can-fail: true
|
||||||
|
replacements: |
|
||||||
|
version=4.2.0
|
||||||
|
tool=myTool
|
||||||
|
prog=program
|
||||||
|
nightly_name: inventory
|
||||||
|
nightly_title: "Nightly Test Release with Inventory"
|
||||||
|
nightly_description: |
|
||||||
|
This *nightly* release contains all latest and important artifacts created by %tool%'s CI pipeline.
|
||||||
|
|
||||||
|
# %tool% %version%
|
||||||
|
|
||||||
|
* %prog%
|
||||||
|
* iventory.json
|
||||||
|
inventory-json: "inventory.json"
|
||||||
|
inventory-version: 4.2.5
|
||||||
|
inventory-categories: "kind1,kind2"
|
||||||
|
assets: |
|
||||||
|
# artifact: file: labels: asset title
|
||||||
|
document: document1.txt: doc,html: Documentation
|
||||||
|
document: build.log: build,log: Logfile - %tool% - %tool%
|
||||||
|
other: document1.txt: build,SBOM:SBOM - %version%
|
||||||
|
other: %prog%.py: app,binary:Application - %tool% - %version%
|
||||||
|
document:!archive1.zip: Archive 1 - zip
|
||||||
|
document:!archive2.tgz: Archive 2 - tgz
|
||||||
|
document:!archive3.tar.gz: Archive 3 - tar.gz
|
||||||
|
document:!archive4.tzst: Archive 4 - tzst
|
||||||
|
document:!archive5.tar.zst: Archive 5 - tar.zst
|
||||||
|
document:$archive6.tgz: Archive 6 - tgz + dir
|
||||||
|
document:$archive7.tar.gz: Archive 7 - tar.gz + dir
|
||||||
|
document:$archive8.tzst: Archive 8 - tzst + dir
|
||||||
|
document:$archive9.tar.zst: Archive 9 - tar.zst + dir
|
||||||
|
secrets: inherit
|
||||||
157
.github/workflows/_Checking_Parameters.yml
vendored
157
.github/workflows/_Checking_Parameters.yml
vendored
@@ -6,54 +6,54 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Params_Default:
|
Params_Default:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
|
|
||||||
Params_PythonVersions:
|
Params_PythonVersions:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.9 3.10 pypy-3.8 pypy-3.9"
|
python_version_list: "3.11 3.12 pypy-3.9 pypy-3.10"
|
||||||
|
|
||||||
Params_Systems:
|
Params_Systems:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
system_list: "windows mingw32 mingw64"
|
system_list: "windows mingw32 mingw64"
|
||||||
|
|
||||||
Params_Include:
|
Params_Include:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.10"
|
python_version_list: "3.11"
|
||||||
system_list: "ubuntu windows macos"
|
system_list: "ubuntu windows macos macos-arm"
|
||||||
include_list: "ubuntu:3.11 ubuntu:3.12"
|
include_list: "ubuntu:3.12 ubuntu:3.13"
|
||||||
|
|
||||||
Params_Exclude:
|
Params_Exclude:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.10"
|
python_version_list: "3.12"
|
||||||
system_list: "ubuntu windows macos"
|
system_list: "ubuntu windows macos macos-arm"
|
||||||
exclude_list: "windows:3.10 windows:3.11"
|
exclude_list: "windows:3.12 windows:3.13"
|
||||||
|
|
||||||
Params_Disable:
|
Params_Disable:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.10"
|
python_version_list: "3.12"
|
||||||
system_list: "ubuntu windows macos"
|
system_list: "ubuntu windows macos macos-arm"
|
||||||
disable_list: "windows:3.10 windows:3.11"
|
disable_list: "windows:3.12 windows:3.13"
|
||||||
|
|
||||||
Params_All:
|
Params_All:
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
||||||
with:
|
with:
|
||||||
name: Example
|
name: Example
|
||||||
python_version_list: "3.10 3.11"
|
python_version_list: "3.12 3.13"
|
||||||
system_list: "ubuntu windows macos"
|
system_list: "ubuntu windows macos macos-arm"
|
||||||
include_list: "windows:3.8 windows:3.9 windows:3.12"
|
include_list: "windows:3.10 windows:3.11 windows:3.13"
|
||||||
exclude_list: "macos:3.10 macos:3.11"
|
exclude_list: "macos:3.12 macos:3.13"
|
||||||
|
|
||||||
Params_Check:
|
Params_Check:
|
||||||
needs:
|
needs:
|
||||||
@@ -64,14 +64,14 @@ jobs:
|
|||||||
- Params_Exclude
|
- Params_Exclude
|
||||||
- Params_Disable
|
- Params_Disable
|
||||||
- Params_All
|
- Params_All
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: python
|
shell: python
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: pip install pyTooling
|
run: pip install --disable-pip-version-check --break-system-packages pyTooling
|
||||||
# Params_Default
|
# Params_Default
|
||||||
- name: Checking results from 'Params_Default'
|
- name: Checking results from 'Params_Default'
|
||||||
run: |
|
run: |
|
||||||
@@ -80,10 +80,10 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
expectedPythons = ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
expectedSystems = ["ubuntu", "windows", "macos"]
|
expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.11", "ucrt64:3.11"]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.12", "ucrt64:3.11"]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
||||||
@@ -112,8 +112,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -136,10 +143,10 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.9", "3.10", "pypy-3.8", "pypy-3.9"]
|
expectedPythons = ["3.11", "3.12", "pypy-3.9", "pypy-3.10"]
|
||||||
expectedSystems = ["ubuntu", "windows", "macos"]
|
expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.11", "ucrt64:3.11"]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw64:3.12", "ucrt64:3.11"]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
||||||
@@ -168,8 +175,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -192,10 +206,10 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
expectedPythons = ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
expectedSystems = ["windows"]
|
expectedSystems = ["windows"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw32:3.11", "mingw64:3.11"]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["mingw32:3.12", "mingw64:3.11"]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
||||||
@@ -224,8 +238,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -248,9 +269,9 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.10"]
|
expectedPythons = ["3.12"]
|
||||||
expectedSystems = ["ubuntu", "windows", "macos"]
|
expectedSystems = ["ubuntu", "windows", "macos", "macos-arm"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["ubuntu:3.11", "ubuntu:3.12"]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["ubuntu:3.11", "ubuntu:3.12"]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
@@ -280,8 +301,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -304,9 +332,9 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.10"]
|
expectedPythons = ["3.12"]
|
||||||
expectedSystems = ["ubuntu", "macos"]
|
expectedSystems = ["ubuntu", "macos", "macos-arm"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
@@ -336,8 +364,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -360,9 +395,9 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.10"]
|
expectedPythons = ["3.12"]
|
||||||
expectedSystems = ["ubuntu", "macos"]
|
expectedSystems = ["ubuntu", "macos", "macos-arm"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
@@ -392,8 +427,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
@@ -416,10 +458,10 @@ jobs:
|
|||||||
|
|
||||||
from pyTooling.Common import zipdicts
|
from pyTooling.Common import zipdicts
|
||||||
|
|
||||||
expectedPythonVersion = "3.12"
|
expectedPythonVersion = "3.13"
|
||||||
expectedPythons = ["3.10", "3.11"]
|
expectedPythons = ["3.12", "3.13"]
|
||||||
expectedSystems = ["ubuntu", "windows"]
|
expectedSystems = ["ubuntu", "macos-arm", "windows"]
|
||||||
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["windows:3.8", "windows:3.9", "windows:3.12"]
|
expectedJobs = [f"{system}:{python}" for system in expectedSystems for python in expectedPythons] + ["windows:3.10", "windows:3.11", "windows:3.13"]
|
||||||
expectedName = "Example"
|
expectedName = "Example"
|
||||||
expectedArtifacts = {
|
expectedArtifacts = {
|
||||||
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
"unittesting_xml": f"{expectedName}-UnitTestReportSummary-XML",
|
||||||
@@ -448,8 +490,15 @@ jobs:
|
|||||||
errors += 1
|
errors += 1
|
||||||
if len(actualPythonJobs) != len(expectedJobs):
|
if len(actualPythonJobs) != len(expectedJobs):
|
||||||
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
print(f"Number of 'python_jobs' does not match: {len(actualPythonJobs)} != {len(expectedJobs)}.")
|
||||||
|
print("Actual jobs:")
|
||||||
for job in actualPythonJobs:
|
for job in actualPythonJobs:
|
||||||
print(f" {job['system']}:{job['python']}")
|
if job['system'] == "msys2":
|
||||||
|
print(f" {job['runtime'].lower()}:{job['python']}")
|
||||||
|
else:
|
||||||
|
print(f" {job['system']}:{job['python']}")
|
||||||
|
print("Expected jobs:")
|
||||||
|
for job in expectedJobs:
|
||||||
|
print(f" {job}")
|
||||||
errors += 1
|
errors += 1
|
||||||
if len(actualArtifactNames) != len(expectedArtifacts):
|
if len(actualArtifactNames) != len(expectedArtifacts):
|
||||||
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
print(f"Number of 'artifact_names' does not match: {len(actualArtifactNames)} != {len(expectedArtifacts)}.")
|
||||||
|
|||||||
191
.github/workflows/_Checking_Pipeline.yml
vendored
191
.github/workflows/_Checking_Pipeline.yml
vendored
@@ -1,191 +0,0 @@
|
|||||||
name: Verification of Complete Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
UnitTestingParams:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
|
||||||
with:
|
|
||||||
name: pyDummy
|
|
||||||
python_version_list: "3.8 3.9 3.10 3.11 3.12 pypy-3.8 pypy-3.9 pypy-3.10"
|
|
||||||
disable_list: "windows:pypy-3.10"
|
|
||||||
|
|
||||||
PlatformTestingParams:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
|
|
||||||
with:
|
|
||||||
name: Platform
|
|
||||||
python_version_list: ""
|
|
||||||
system_list: "ubuntu windows macos mingw32 mingw64 clang64 ucrt64"
|
|
||||||
|
|
||||||
UnitTesting:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
with:
|
|
||||||
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
|
|
||||||
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
|
|
||||||
unittest_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
|
|
||||||
# coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
||||||
# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
|
||||||
# coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
|
||||||
# coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
||||||
|
|
||||||
PlatformTesting:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1
|
|
||||||
needs:
|
|
||||||
- PlatformTestingParams
|
|
||||||
with:
|
|
||||||
jobs: ${{ needs.PlatformTestingParams.outputs.python_jobs }}
|
|
||||||
# tests_directory: ""
|
|
||||||
unittest_directory: platform
|
|
||||||
unittest_xml_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_xml }}
|
|
||||||
unittest_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_html }}
|
|
||||||
coverage_sqlite_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
||||||
coverage_xml_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_xml }}
|
|
||||||
coverage_json_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_json }}
|
|
||||||
coverage_html_artifact: ${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
||||||
|
|
||||||
# Coverage:
|
|
||||||
# uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r1
|
|
||||||
# needs:
|
|
||||||
# - UnitTestingParams
|
|
||||||
# with:
|
|
||||||
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
||||||
# artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
||||||
# secrets:
|
|
||||||
# codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
||||||
|
|
||||||
StaticTypeCheck:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
with:
|
|
||||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
||||||
commands: |
|
|
||||||
mypy --html-report htmlmypy -p pyDummy
|
|
||||||
html_report: 'htmlmypy'
|
|
||||||
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
|
|
||||||
|
|
||||||
PublishCoverageResults:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
- UnitTesting
|
|
||||||
- PlatformTesting
|
|
||||||
# - Coverage
|
|
||||||
with:
|
|
||||||
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
|
|
||||||
coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
|
|
||||||
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
|
|
||||||
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
|
|
||||||
secrets:
|
|
||||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
||||||
|
|
||||||
PublishTestResults:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTesting
|
|
||||||
- PlatformTesting
|
|
||||||
|
|
||||||
Package:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Package.yml@r1
|
|
||||||
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@r1
|
|
||||||
# needs:
|
|
||||||
# - UnitTestingParams
|
|
||||||
# with:
|
|
||||||
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
||||||
|
|
||||||
BuildTheDocs:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
# - VerifyDocs
|
|
||||||
with:
|
|
||||||
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
|
|
||||||
|
|
||||||
PublishToGitHubPages:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
- BuildTheDocs
|
|
||||||
# - Coverage
|
|
||||||
- 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 }}
|
|
||||||
|
|
||||||
ReleasePage:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Release.yml@r1
|
|
||||||
if: startsWith(github.ref, 'refs/tags')
|
|
||||||
needs:
|
|
||||||
- UnitTesting
|
|
||||||
- PlatformTesting
|
|
||||||
# - Coverage
|
|
||||||
# - StaticTypeCheck
|
|
||||||
- Package
|
|
||||||
- PublishToGitHubPages
|
|
||||||
|
|
||||||
PublishOnPyPI:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r1
|
|
||||||
if: startsWith(github.ref, 'refs/tags')
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
- ReleasePage
|
|
||||||
# - Package
|
|
||||||
with:
|
|
||||||
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
|
|
||||||
requirements: -r dist/requirements.txt
|
|
||||||
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
||||||
secrets:
|
|
||||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
||||||
|
|
||||||
ArtifactCleanUp:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1
|
|
||||||
needs:
|
|
||||||
- UnitTestingParams
|
|
||||||
- PlatformTestingParams
|
|
||||||
- UnitTesting
|
|
||||||
- PlatformTesting
|
|
||||||
# - Coverage
|
|
||||||
- StaticTypeCheck
|
|
||||||
# - BuildTheDocs
|
|
||||||
- PublishToGitHubPages
|
|
||||||
- PublishCoverageResults
|
|
||||||
- PublishTestResults
|
|
||||||
with:
|
|
||||||
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
|
|
||||||
remaining: |
|
|
||||||
${{ 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).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.PlatformTestingParams.outputs.artifact_names).unittesting_xml }}-*
|
|
||||||
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_html }}-*
|
|
||||||
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_sqlite }}-*
|
|
||||||
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_xml }}-*
|
|
||||||
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_json }}-*
|
|
||||||
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }}-*
|
|
||||||
19
.github/workflows/_Checking_SimplePackage_Pipeline.yml
vendored
Normal file
19
.github/workflows/_Checking_SimplePackage_Pipeline.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Verification of Pipeline Templates (Simple Package)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
SimplePackage:
|
||||||
|
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@main
|
||||||
|
with:
|
||||||
|
package_name: pyDummy
|
||||||
|
codecov: true
|
||||||
|
codacy: true
|
||||||
|
dorny: true
|
||||||
|
cleanup: false
|
||||||
|
secrets:
|
||||||
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
CODACY_TOKEN: ${{ secrets.CODACY_TOKEN }}
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -13,6 +13,7 @@ coverage.xml
|
|||||||
|
|
||||||
# pytest
|
# pytest
|
||||||
/report/unit
|
/report/unit
|
||||||
|
/tests/*.github
|
||||||
|
|
||||||
# setuptools
|
# setuptools
|
||||||
/build/**/*.*
|
/build/**/*.*
|
||||||
@@ -30,7 +31,7 @@ doc/pyDummy/**/*.*
|
|||||||
# BuildTheDocs
|
# BuildTheDocs
|
||||||
doc/_theme/**/*.*
|
doc/_theme/**/*.*
|
||||||
|
|
||||||
# IntelliJ project files
|
# PyCharm project files
|
||||||
/.idea/workspace.xml
|
/.idea/workspace.xml
|
||||||
|
|
||||||
# Git files
|
# Git files
|
||||||
|
|||||||
2
.idea/Actions.iml
generated
2
.idea/Actions.iml
generated
@@ -2,7 +2,7 @@
|
|||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
# ==================================================================================================================== #
|
|
||||||
# Authors: #
|
|
||||||
# Patrick Lehmann #
|
|
||||||
# Unai Martinez-Corral #
|
|
||||||
# #
|
|
||||||
# ==================================================================================================================== #
|
|
||||||
# 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: Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# This job is a workaround for global variables
|
|
||||||
# See https://github.com/actions/runner/issues/480
|
|
||||||
Params:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Parameters.yml@main
|
|
||||||
with:
|
|
||||||
name: ToolName
|
|
||||||
# Optional
|
|
||||||
system_list: 'ubuntu windows msys2 macos'
|
|
||||||
python_version: '3.10'
|
|
||||||
python_version_list: '3.8 3.9 3.10'
|
|
||||||
|
|
||||||
UnitTesting:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
with:
|
|
||||||
jobs: ${{ needs.Params.outputs.python_jobs }}
|
|
||||||
# Optional
|
|
||||||
requirements: '-r tests/requirements.txt'
|
|
||||||
pacboy: >-
|
|
||||||
python-pip:p
|
|
||||||
python-wheel:p
|
|
||||||
python-coverage:p
|
|
||||||
python-lxml:p
|
|
||||||
mingw_requirements: '-r tests/requirements.mingw.txt'
|
|
||||||
tests_directory: 'tests'
|
|
||||||
unittest_directory: 'unit'
|
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}
|
|
||||||
|
|
||||||
Coverage:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
with:
|
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }}
|
|
||||||
# Optional
|
|
||||||
python_version: ${{ needs..Params.outputs.python_version }}
|
|
||||||
requirements: '-r tests/requirements.txt'
|
|
||||||
tests_directory: 'tests'
|
|
||||||
unittest_directory: 'unit'
|
|
||||||
secrets:
|
|
||||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
||||||
|
|
||||||
StaticTypeCheck:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
with:
|
|
||||||
commands: |
|
|
||||||
mypy --junit-xml StaticTypingSummary.xml --html-report htmlmypy -p ToolName
|
|
||||||
html_artifact: ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }}
|
|
||||||
junit_artifact: ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_junit }}
|
|
||||||
# Optional
|
|
||||||
python_version: ${{ needs..Params.outputs.python_version }}
|
|
||||||
requirements: '-r tests/requirements.txt'
|
|
||||||
html_report: 'htmlmypy'
|
|
||||||
junit_report: 'StaticTypingSummary.xml'
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
PublishTestResults:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@main
|
|
||||||
needs:
|
|
||||||
- UnitTesting
|
|
||||||
- StaticTypeCheck
|
|
||||||
with:
|
|
||||||
# Optional
|
|
||||||
report_files: artifacts/**/*.xml
|
|
||||||
|
|
||||||
Package:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Package.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
- Coverage
|
|
||||||
with:
|
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
|
||||||
# Optional
|
|
||||||
python_version: ${{ needs..Params.outputs.python_version }}
|
|
||||||
requirements: 'wheel'
|
|
||||||
|
|
||||||
Release:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/Release.yml@main
|
|
||||||
if: startsWith(github.ref, 'refs/tags')
|
|
||||||
needs:
|
|
||||||
- UnitTesting
|
|
||||||
- Coverage
|
|
||||||
- StaticTypeCheck
|
|
||||||
- Package
|
|
||||||
|
|
||||||
PublishOnPyPI:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@main
|
|
||||||
if: startsWith(github.ref, 'refs/tags')
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
- Release
|
|
||||||
- Package
|
|
||||||
with:
|
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
|
||||||
# Optional
|
|
||||||
python_version: ${{ needs..Params.outputs.python_version }}
|
|
||||||
requirements: 'wheel twine'
|
|
||||||
secrets:
|
|
||||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
||||||
|
|
||||||
VerifyDocs:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
with:
|
|
||||||
# Optional
|
|
||||||
python_version: ${{ needs..Params.outputs.python_version }}
|
|
||||||
|
|
||||||
BuildTheDocs:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
- VerifyDocs
|
|
||||||
with:
|
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }}
|
|
||||||
|
|
||||||
PublishToGitHubPages:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
- BuildTheDocs
|
|
||||||
- Coverage
|
|
||||||
- StaticTypeCheck
|
|
||||||
with:
|
|
||||||
doc: ${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }}
|
|
||||||
# Optional
|
|
||||||
coverage: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }}
|
|
||||||
typing: ${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }}
|
|
||||||
|
|
||||||
ArtifactCleanUp:
|
|
||||||
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
|
|
||||||
needs:
|
|
||||||
- Params
|
|
||||||
- PublishTestResults
|
|
||||||
- Coverage
|
|
||||||
- StaticTypeCheck
|
|
||||||
- BuildTheDocs
|
|
||||||
- PublishToGitHubPages
|
|
||||||
with:
|
|
||||||
package: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
|
|
||||||
remaining: |
|
|
||||||
${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-*
|
|
||||||
${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }}
|
|
||||||
${{ fromJson(needs.Params.outputs.artifact_names).statictyping_html }}
|
|
||||||
${{ fromJson(needs.Params.outputs.artifact_names).statictyping_junit }}
|
|
||||||
${{ fromJson(needs.Params.outputs.artifact_names).documentation_html }}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 135 KiB |
111
README.md
111
README.md
@@ -10,52 +10,97 @@ This repository gathers reusable CI tooling for testing, packaging and distribut
|
|||||||
See [GitHub Actions and GitHub Reusable Workflows](https://pytooling.github.io/Actions/Background.html) for more
|
See [GitHub Actions and GitHub Reusable Workflows](https://pytooling.github.io/Actions/Background.html) for more
|
||||||
background information.
|
background information.
|
||||||
|
|
||||||
## Reusable workflows
|
## Reusable Actions
|
||||||
|
|
||||||
|
- **Artifacts:**
|
||||||
|
[**pyTooling/upload-artifact**](https://github.com/pyTooling/upload-artifact): The upload-artifact action will
|
||||||
|
preserve file attributes like permissions.
|
||||||
|
|
||||||
|
[**pyTooling/download-artifact**](https://github.com/pyTooling/download-artifact): The download-artifact action will
|
||||||
|
preserve file attributes like permissions.
|
||||||
|
|
||||||
|
## Predefined Docker Images
|
||||||
|
|
||||||
|
- **Documentation:**
|
||||||
|
[**MikTeX**](https://github.com/pyTooling/MikTeX): A predefined MikTeX image based on Debian Bookworm + Python 3.13
|
||||||
|
with specific tools for documentation generation using e.g. Sphinx and related extensions.
|
||||||
|
|
||||||
|
## Reusable Workflows
|
||||||
|
|
||||||
This repository provides 10+ *Reusable Workflows* based on the CI pipelines of the repos in this GitHub organisation,
|
This repository provides 10+ *Reusable Workflows* based on the CI pipelines of the repos in this GitHub organisation,
|
||||||
[EDA²](https://github.com/edaa-org), [VHDL](https://github.com/vhdl), and others. By combining them, Python packages can
|
[EDA²](https://github.com/edaa-org), [VHDL](https://github.com/vhdl), and others. By combining them, Python packages can
|
||||||
be continuously tested and released along with Sphinx documentation sites, to GitHub Releases, GitHub Pages and PyPI.
|
be continuously tested and released along with Sphinx documentation sites, to GitHub Releases, GitHub Pages and PyPI.
|
||||||
Optionally, coverage and static type check reports can be gathered and integrated into the online documentation.
|
Optionally, coverage and static type check reports can be gathered and integrated into the online documentation.
|
||||||
|
|
||||||
[](ExamplePipeline_dark.png)
|
[](doc/_static/pyTooling-Actions-SimplePackage.png)
|
||||||
|
|
||||||
[](ExamplePipeline_light.png)
|
|
||||||
|
|
||||||
As shown in the screenshots above, the expected order is:
|
As shown in the screenshots above, the expected order is:
|
||||||
|
|
||||||
- Global:
|
- **Global:**
|
||||||
- [Parameters](.github/workflows/Parameters.yml): a workaround for the limitations to handle global variables in
|
[**Parameters**](.github/workflows/Parameters.yml): It generates output parameters with artifact names and job matrices
|
||||||
GitHub Actions workflows (see [actions/runner#480](https://github.com/actions/runner/issues/480)).
|
to be used in later running jobs.
|
||||||
It generates outputs with artifact names and job matrices to be used in later running jobs.
|
It's a workaround for the limitations to handle global variables in GitHub Actions workflows (see
|
||||||
- Code testing/analysis:
|
[actions/runner#480](https://github.com/actions/runner/issues/480)).
|
||||||
- [UnitTesting](.github/workflows/UnitTesting.yml): run unit test with `pytest` using multiple versions of Python, and
|
|
||||||
optionally upload results as XML reports. Configuration options to `pytest` should be given via section
|
[**ExtractConfiguration**](.github/workflows/ExtractConfiguration.yml): extracts configuration values from
|
||||||
`[tool.pytest.ini_options]` in a `pyproject.toml` file.
|
`pyproject.toml` and exposes configured paths and filenames as job output parameters.
|
||||||
- [CoverageCollection](.github/workflows/CoverageCollection.yml): collect code coverage data (incl. branch coverage)
|
- **Predefined pipelines:**
|
||||||
with `pytest`/`pytest-cov`/`coverage.py` using a single version of Python (latest). It generates HTML and Cobertura
|
[**CompletePipeline**](.github/workflows/CompletePipeline.yml): is a predefined pipeline for typical Python projects
|
||||||
(XML)reports, upload the HTML report as an artifact, and upload the test results to Codecov and Codacy. Configuration
|
using all predefined job templates of pyTooling at once: (unit testing, code coverage, static typing, documentation
|
||||||
options to `pytest` and `coverage.py` should be given via section `[tool.pytest.ini_options]` and `[tool.coverage.*]`
|
report generation and publishing, packaging, releasing, ...)
|
||||||
in a `pyproject.toml` file.
|
- **Code testing/analysis:**
|
||||||
- [StaticTypeCheck](.github/workflows/StaticTypeCheck.yml): collect static type check result with `mypy`, and
|
[**ApplicationTesting**](.github/workflows/ApplicationTesting.yml): like UnitTesting, but running tests using an
|
||||||
optionally upload results as an HTML report.
|
installed Python package.
|
||||||
Example `commands`:
|
|
||||||
|
[**UnitTesting**](.github/workflows/UnitTesting.yml): run unit test with `pytest` using multiple versions of Python, and
|
||||||
|
optionally upload results as XML reports. Configuration options to `pytest` should be given via section
|
||||||
|
`[tool.pytest.ini_options]` in a `pyproject.toml` file.
|
||||||
|
Besides test results, also code coverage data (incl. branch coverage) can be collected using
|
||||||
|
`pytest`/`pytest-cov`/`coverage.py`. Configuration options to `coverage.py` should be given via section
|
||||||
|
`[tool.coverage.*]` in a `pyproject.toml` file.
|
||||||
|
While multiple report formats can be created in the job, it's recommended to use `PublishTestResults` and/or
|
||||||
|
`PublishCoverageResults` to merge results from matrix runs and then generate final reports as XML, JSON or HTML.
|
||||||
|
Finally, reports can be published to GitHub Pages or cloud services like Codecov and Codacy.
|
||||||
|
|
||||||
|
[**StaticTypeCheck**](.github/workflows/StaticTypeCheck.yml): collect static type check result with `mypy`, and
|
||||||
|
optionally upload results as an HTML report.
|
||||||
|
|
||||||
|
[**VerifyDocs**](.github/workflows/VerifyDocs.yml): extract code examples from the README and test these code snippets.
|
||||||
|
- **Packaging and releasing:**
|
||||||
|
[**Package**](.github/workflows/Package.yml): generate source and wheel packages, and upload them as an artifact.
|
||||||
|
|
||||||
|
[**PublishOnPyPI**](.github/workflows/PublishOnPyPI.yml): publish source and wheel packages to PyPI.
|
||||||
|
|
||||||
|
[**PublishTestResults**](.github/workflows/PublishTestResults.yml): publish unit test results through GH action `dorny/test-reporter`.
|
||||||
|
|
||||||
|
[**PublishCoverageResults**](.github/workflows/PublishCoverageResults.yml): publish ucode coverage results.
|
||||||
|
|
||||||
|
[**NightlyRelease**](.github/workflows/NightlyRelease.yml): publish GitHub Release.
|
||||||
|
|
||||||
|
[**PublishReleaseNotes**](.github/workflows/PublishReleaseNotes.yml): publish GitHub Release.
|
||||||
|
- **Documentation:**
|
||||||
|
[**SphinxDocumentation**](.github/workflows/PublishCoverageResults.yml): create HTML and LaTeX documentation using
|
||||||
|
Sphinx.
|
||||||
|
|
||||||
|
[**LaTeXDocumentation**](.github/workflows/LaTeXDocumentation.yml): compile LaTeX documentation to a PDF file using
|
||||||
|
MikTeX.
|
||||||
|
|
||||||
|
[**PublishToGitHubPages**](.github/workflows/PublishToGitHubPages.yml): publish HTML documentation to GitHub Pages.
|
||||||
|
- **Cleanup:**
|
||||||
|
[**IntermediateCleanUp**](.github/workflows/IntermediateCleanUp.yml): delete intermediate artifacts.
|
||||||
|
|
||||||
|
[**ArtifactCleanUp**](.github/workflows/ArtifactCleanUp.yml): delete artifacts.
|
||||||
|
- **⚠ Deprecated ⚠:**
|
||||||
|
[**CoverageCollection**](.github/workflows/CoverageCollection.yml): Use `UnitTesting`, because is can collect code
|
||||||
|
coverage too. This avoids code duplication in job templates.
|
||||||
|
|
||||||
|
[**BuildTheDocs**](.github/workflows/BuildTheDocs.yml): Use `SphinxDocumentation`, `LaTeXDocumentation` and
|
||||||
|
`PublishToGitHubPages`. BuildTheDocs isn't maintained anymore.
|
||||||
|
|
||||||
- [VerifyDocs](.github/workflows/VerifyDocs.yml): extract code examples from the README and test these code snippets.
|
|
||||||
- Packaging and releasing:
|
|
||||||
- [Release](.github/workflows/Release.yml): publish GitHub Release.
|
|
||||||
- [Package](.github/workflows/Package.yml): generate source and wheel packages, and upload them as an artifact.
|
|
||||||
- [PublishOnPyPI](.github/workflows/PublishOnPyPI.yml): publish source and wheel packages to PyPI.
|
|
||||||
- [PublishTestResults](.github/workflows/PublishTestResults.yml): publish unit test results through GH action `dorny/test-reporter`.
|
|
||||||
- Documentation:
|
|
||||||
- [BuildTheDocs](.github/workflows/BuildTheDocs.yml): build Sphinx documentation with BuildTheDocs, and upload HTML as
|
|
||||||
an artifact.
|
|
||||||
- [PublishToGitHubPages](.github/workflows/PublishToGitHubPages.yml): publish HTML documentation to GitHub Pages.
|
|
||||||
- Cleanup:
|
|
||||||
- [ArtifactCleanUp](.github/workflows/ArtifactCleanUp.yml): delete artifacts.
|
|
||||||
|
|
||||||
### Example pipeline
|
### Example pipeline
|
||||||
|
|
||||||
[ExamplePipeline.yml](ExamplePipeline.yml) is an example Workflow which uses all of the Reusable Workflows.
|
ExamplePipeline.yml is an example Workflow which uses all of the Reusable Workflows.
|
||||||
Python package/tool developers can copy it into their repos, in order to use al the reusable workflows straightaway.
|
Python package/tool developers can copy it into their repos, in order to use al the reusable workflows straightaway.
|
||||||
Minimal required modifications are the following:
|
Minimal required modifications are the following:
|
||||||
|
|
||||||
|
|||||||
2
dist/requirements.txt
vendored
Normal file
2
dist/requirements.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
wheel ~= 0.45
|
||||||
|
twine ~= 6.1
|
||||||
@@ -81,11 +81,11 @@ The following block shows a minimal YAML workflow file:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
mwe:
|
mwe:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
# Build your application, tool, artifacts, etc.
|
# Build your application, tool, artifacts, etc.
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -171,7 +171,7 @@ For prototyping purposes, the following job might be useful:
|
|||||||
|
|
||||||
Release:
|
Release:
|
||||||
name: '📦 Release'
|
name: '📦 Release'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
- ...
|
- ...
|
||||||
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'>`__)
|
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'>`__)
|
||||||
|
|||||||
@@ -76,11 +76,11 @@ Documentation Only (Sphinx)
|
|||||||
needs:
|
needs:
|
||||||
- BuildTheDocs
|
- BuildTheDocs
|
||||||
- PublishToGitHubPages
|
- PublishToGitHubPages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 🗑️ Delete artifacts
|
- name: 🗑️ Delete artifacts
|
||||||
uses: geekyeggo/delete-artifact@v2
|
uses: geekyeggo/delete-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: Documentation
|
name: Documentation
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,7 @@ Simple Example
|
|||||||
uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r0
|
uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r0
|
||||||
with:
|
with:
|
||||||
artifact: Coverage
|
artifact: Coverage
|
||||||
secrets:
|
secrets: inherit
|
||||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
||||||
|
|
||||||
Complex Example
|
Complex Example
|
||||||
===============
|
===============
|
||||||
@@ -71,8 +70,7 @@ Complex Example
|
|||||||
with:
|
with:
|
||||||
python_version: ${{ needs.Params.outputs.python_version }}
|
python_version: ${{ needs.Params.outputs.python_version }}
|
||||||
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }}
|
artifact: ${{ fromJson(needs.Params.outputs.artifact_names).codecoverage_html }}
|
||||||
secrets:
|
secrets: inherit
|
||||||
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
**********
|
**********
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ Complex Example
|
|||||||
|
|
||||||
The following instantiation example creates 3 jobs from the same template, but with differing input parameters. The
|
The following instantiation example creates 3 jobs from the same template, but with differing input parameters. The
|
||||||
first job `UnitTestingParams` might be used to create a job matrix of unit tests. It creates the cross of default
|
first job `UnitTestingParams` might be used to create a job matrix of unit tests. It creates the cross of default
|
||||||
systems (Windows, Ubuntu, MacOS, MinGW64, UCRT64) and the given list of Python versions including some mypy versions. In
|
systems (Windows, Ubuntu, macOS, MinGW64, UCRT64) and the given list of Python versions including some mypy versions. In
|
||||||
addition a list of excludes (marked as :deletion:`deletions`) and includes (marked as :addition:`additions`) is handed
|
addition a list of excludes (marked as :deletion:`deletions`) and includes (marked as :addition:`additions`) is handed
|
||||||
over resulting in the following combinations:
|
over resulting in the following combinations:
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ over resulting in the following combinations:
|
|||||||
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
||||||
| Ubuntu 🐧 | ubuntu:3.8 | ubuntu:3.9 | ubuntu:3.10 | ubuntu:3.11 | :addition:`ubuntu:3.12` | | | ubuntu:pypy-3.9 | ubuntu:pypy-3.10 |
|
| Ubuntu 🐧 | ubuntu:3.8 | ubuntu:3.9 | ubuntu:3.10 | ubuntu:3.11 | :addition:`ubuntu:3.12` | | | ubuntu:pypy-3.9 | ubuntu:pypy-3.10 |
|
||||||
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
||||||
| MacOS 🍎 | macos:3.8 | macos:3.9 | macos:3.10 | macos:3.11 | :addition:`macos:3.12` | | | macos:pypy-3.9 | macos:pypy-3.10 |
|
| macOS 🍎 | macos:3.8 | macos:3.9 | macos:3.10 | macos:3.11 | :addition:`macos:3.12` | | | macos:pypy-3.9 | macos:pypy-3.10 |
|
||||||
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
||||||
| MSYS 🟪 | | | | | | | | | |
|
| MSYS 🟪 | | | | | | | | | |
|
||||||
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
+------------+-------------+-------------+--------------+--------------+-------------------------+------------+-------------+------------------------------+-------------------------------+
|
||||||
@@ -138,7 +138,7 @@ python_version_list
|
|||||||
| Parameter Name | Required | Type | Default |
|
| Parameter Name | Required | Type | Default |
|
||||||
+======================+==========+==========+============================+
|
+======================+==========+==========+============================+
|
||||||
| python_version_list | optional | string | ``3.8 3.9 3.10 3.11 3.12`` |
|
| python_version_list | optional | string | ``3.8 3.9 3.10 3.11 3.12`` |
|
||||||
+----------------------+----------+----------+-------------------------- -+
|
+----------------------+----------+----------+----------------------------+
|
||||||
|
|
||||||
Space separated list of CPython versions and/or mypy version to run tests with.
|
Space separated list of CPython versions and/or mypy version to run tests with.
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ Space separated list of systems to run tests on.
|
|||||||
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
||||||
| 🐧 | Ubuntu | Ubuntu 22.04 (LTS) (latest) | |
|
| 🐧 | Ubuntu | Ubuntu 22.04 (LTS) (latest) | |
|
||||||
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
||||||
| 🍎 | MacOS | macOS Monterey 12 (latest) | While this marked latest, macOS Ventura 13 is already provided. |
|
| 🍎 | macOS | macOS Monterey 12 (latest) | While this marked latest, macOS Ventura 13 is already provided. |
|
||||||
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
||||||
| 🟪 | MSYS | | |
|
| 🟪 | MSYS | | |
|
||||||
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
+------+-----------+------------------------------+-----------------------------------------------------------------+
|
||||||
|
|||||||
@@ -12,13 +12,36 @@ This job creates a Release Page on GitHub.
|
|||||||
**Automated Release created on: ${{ steps.getVariables.outputs.datetime }}**
|
**Automated Release created on: ${{ steps.getVariables.outputs.datetime }}**
|
||||||
|
|
||||||
# New Features
|
# New Features
|
||||||
|
|
||||||
|
* tbd
|
||||||
* tbd
|
* tbd
|
||||||
|
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
* tbd
|
||||||
* tbd
|
* tbd
|
||||||
|
|
||||||
# Bug Fixes
|
# Bug Fixes
|
||||||
|
|
||||||
* tbd
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
|
||||||
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
# Unit Tests
|
||||||
|
|
||||||
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
----------
|
||||||
|
# Related Issues and Pull-Requests
|
||||||
|
|
||||||
|
* tbd
|
||||||
|
* tbd
|
||||||
|
|
||||||
|
|
||||||
**Behavior:**
|
**Behavior:**
|
||||||
|
|
||||||
|
|||||||
115
doc/_static/css/override.css
vendored
Normal file
115
doc/_static/css/override.css
vendored
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/* theme overrides */
|
||||||
|
.rst-content h1,
|
||||||
|
.rst-content h2 {
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rst-content h3,
|
||||||
|
.rst-content h4,
|
||||||
|
.rst-content h5,
|
||||||
|
.rst-content h6 {
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rst-content p {
|
||||||
|
margin-bottom: 6px
|
||||||
|
}
|
||||||
|
|
||||||
|
/* general overrides */
|
||||||
|
html {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
font-size: 95%;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
footer p {
|
||||||
|
margin-bottom: 0px /* 12px */;
|
||||||
|
font-size: 95%
|
||||||
|
}
|
||||||
|
|
||||||
|
section > p,
|
||||||
|
.section p,
|
||||||
|
.simple li {
|
||||||
|
text-align: justify
|
||||||
|
}
|
||||||
|
|
||||||
|
.rst-content .topic-title {
|
||||||
|
font-size: larger;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-top: 18px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rst-content p.rubric {
|
||||||
|
text-decoration: underline;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-top: 18px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wyrm overrides */
|
||||||
|
.wy-menu-vertical header,
|
||||||
|
.wy-menu-vertical p.caption {
|
||||||
|
color: #9b9b9b /* #55a5d9 */;
|
||||||
|
padding: 0 0.809em /* 0 1.618em */;
|
||||||
|
margin: 6px 0 0 0 /* 12px 0 0 */;
|
||||||
|
border-top: 1px solid #9b9b9b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-side-nav-search {
|
||||||
|
margin-bottom: 0 /* .809em */;
|
||||||
|
background-color: #333333 /* #2980b9 */;
|
||||||
|
/* BTD: */
|
||||||
|
/*color: #fcfcfc*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-side-nav-search input[type=text] {
|
||||||
|
border-radius: 0px /* 50px */;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-side-nav-search .wy-dropdown > a, .wy-side-nav-search > a {
|
||||||
|
/* BTD: */
|
||||||
|
/*color: #fcfcfc;*/
|
||||||
|
margin-bottom: 0.404em /* .809em */;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-side-nav-search > div.version {
|
||||||
|
margin: 0 0 6px 0;
|
||||||
|
/* BTD: */
|
||||||
|
/*margin-top: -.4045em;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-nav .wy-menu-vertical a:hover {
|
||||||
|
background-color: #333333 /* #2980b9 */;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-nav-content {
|
||||||
|
max-width: 1600px /* 800px */ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wy-nav-top {
|
||||||
|
background: #333333 /* #2980b9 */;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sphinx Design */
|
||||||
|
.sd-tab-set {
|
||||||
|
margin: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.sd-tab-set > label {
|
||||||
|
padding-top: .5em;
|
||||||
|
padding-right: 1em;
|
||||||
|
padding-bottom: .5em;
|
||||||
|
padding-left: 1em
|
||||||
|
}
|
||||||
|
|
||||||
|
.sd-container-fluid {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
BIN
doc/_static/pyTooling-Actions-SimplePackage.png
vendored
Normal file
BIN
doc/_static/pyTooling-Actions-SimplePackage.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 555 KiB |
134
doc/conf.py
134
doc/conf.py
@@ -1,20 +1,29 @@
|
|||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
from importlib.util import find_spec
|
|
||||||
from sys import path as sys_path
|
from sys import path as sys_path
|
||||||
from os.path import abspath
|
from os.path import abspath
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from json import loads
|
|
||||||
|
|
||||||
from pyTooling.Packaging import extractVersionInformation
|
from pyTooling.Packaging import extractVersionInformation
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Project configuration
|
||||||
|
# ==============================================================================
|
||||||
|
githubNamespace = "pyTooling"
|
||||||
|
githubProject = "Actions"
|
||||||
|
pythonProject = "pyDummy"
|
||||||
|
directoryName = pythonProject.replace('.', '/')
|
||||||
|
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Project paths
|
||||||
|
# ==============================================================================
|
||||||
ROOT = Path(__file__).resolve().parent
|
ROOT = Path(__file__).resolve().parent
|
||||||
|
|
||||||
sys_path.insert(0, abspath("."))
|
sys_path.insert(0, abspath("."))
|
||||||
sys_path.insert(0, abspath(".."))
|
sys_path.insert(0, abspath(".."))
|
||||||
sys_path.insert(0, abspath("../pyDummy"))
|
sys_path.insert(0, abspath(f"../{directoryName}"))
|
||||||
sys_path.insert(0, abspath("_extensions"))
|
|
||||||
|
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@@ -23,9 +32,7 @@ sys_path.insert(0, abspath("_extensions"))
|
|||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
project = "Actions"
|
packageInformationFile = Path(f"../{directoryName}/__init__.py")
|
||||||
|
|
||||||
packageInformationFile = Path(f"../pyDummy/__init__.py")
|
|
||||||
versionInformation = extractVersionInformation(packageInformationFile)
|
versionInformation = extractVersionInformation(packageInformationFile)
|
||||||
|
|
||||||
author = versionInformation.Author
|
author = versionInformation.Author
|
||||||
@@ -60,10 +67,10 @@ pygments_style = "manni"
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Restructured Text settings
|
# Restructured Text settings
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
prologPath = "prolog.inc"
|
prologPath = Path("prolog.inc")
|
||||||
try:
|
try:
|
||||||
with open(prologPath, "r") as prologFile:
|
with prologPath.open("r", encoding="utf-8") as fileHandle:
|
||||||
rst_prolog = prologFile.read()
|
rst_prolog = fileHandle.read()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print(f"[ERROR:] While reading '{prologPath}'.")
|
print(f"[ERROR:] While reading '{prologPath}'.")
|
||||||
print(ex)
|
print(ex)
|
||||||
@@ -73,30 +80,15 @@ except Exception as ex:
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Options for HTML output
|
# Options for HTML output
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
html_context = {}
|
html_theme = "sphinx_rtd_theme"
|
||||||
ctx = ROOT / "context.json"
|
html_theme_options = {
|
||||||
if ctx.is_file():
|
"logo_only": True,
|
||||||
html_context.update(loads(ctx.open('r').read()))
|
"vcs_pageview_mode": 'blob',
|
||||||
|
"navigation_depth": 5,
|
||||||
if (ROOT / "_theme").is_dir():
|
}
|
||||||
html_theme_path = ["."]
|
html_css_files = [
|
||||||
html_theme = "_theme"
|
'css/override.css',
|
||||||
html_theme_options = {
|
]
|
||||||
"logo_only": True,
|
|
||||||
"home_breadcrumbs": False,
|
|
||||||
"vcs_pageview_mode": 'blob',
|
|
||||||
# "body_max_width": None
|
|
||||||
# "navigation_depth": 5,
|
|
||||||
}
|
|
||||||
elif find_spec("sphinx_rtd_theme") is not None:
|
|
||||||
html_theme = "sphinx_rtd_theme"
|
|
||||||
html_theme_options = {
|
|
||||||
"logo_only": True,
|
|
||||||
"vcs_pageview_mode": 'blob',
|
|
||||||
# "navigation_depth": 5,
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
html_theme = "alabaster"
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
@@ -107,7 +99,7 @@ html_logo = str(Path(html_static_path[0]) / "logo.png")
|
|||||||
html_favicon = str(Path(html_static_path[0]) / "icon.png")
|
html_favicon = str(Path(html_static_path[0]) / "icon.png")
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# Output file base name for HTML help builder.
|
||||||
htmlhelp_basename = "ActionsDoc"
|
htmlhelp_basename = f"{githubProject}Doc"
|
||||||
|
|
||||||
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
||||||
# bottom, using the given strftime format.
|
# bottom, using the given strftime format.
|
||||||
@@ -118,7 +110,7 @@ html_last_updated_fmt = "%d.%m.%Y"
|
|||||||
# Python settings
|
# Python settings
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
modindex_common_prefix = [
|
modindex_common_prefix = [
|
||||||
f"{project}."
|
f"{pythonProject}."
|
||||||
]
|
]
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@@ -160,10 +152,10 @@ latex_elements = {
|
|||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
( master_doc,
|
( master_doc,
|
||||||
"Actions.tex",
|
f"{githubProject}.tex",
|
||||||
"The pyTooling Actions Documentation",
|
f"The {githubProject} Documentation",
|
||||||
"Patrick Lehmann",
|
f"Patrick Lehmann",
|
||||||
"manual"
|
f"manual"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -174,7 +166,6 @@ latex_documents = [
|
|||||||
extensions = [
|
extensions = [
|
||||||
# Standard Sphinx extensions
|
# Standard Sphinx extensions
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.coverage",
|
|
||||||
"sphinx.ext.extlinks",
|
"sphinx.ext.extlinks",
|
||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx.ext.inheritance_diagram",
|
"sphinx.ext.inheritance_diagram",
|
||||||
@@ -186,10 +177,12 @@ extensions = [
|
|||||||
# SphinxContrib extensions
|
# SphinxContrib extensions
|
||||||
"sphinxcontrib.mermaid",
|
"sphinxcontrib.mermaid",
|
||||||
# Other extensions
|
# Other extensions
|
||||||
"sphinx_fontawesome",
|
"sphinx_design",
|
||||||
|
"sphinx_copybutton",
|
||||||
"sphinx_autodoc_typehints",
|
"sphinx_autodoc_typehints",
|
||||||
"sphinx_inline_tabs",
|
|
||||||
"autoapi.sphinx",
|
"autoapi.sphinx",
|
||||||
|
"sphinx_reports",
|
||||||
|
# User defined extensions
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -221,11 +214,11 @@ autodoc_typehints = "both"
|
|||||||
# Sphinx.Ext.ExtLinks
|
# Sphinx.Ext.ExtLinks
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
extlinks = {
|
extlinks = {
|
||||||
"gh": ("https://GitHub.com/%s", "gh:%s"),
|
"gh": (f"https://GitHub.com/%s", "gh:%s"),
|
||||||
"ghissue": ("https://GitHub.com/pyTooling/Actions/issues/%s", "issue #%s"),
|
"ghissue": (f"https://GitHub.com/{githubNamespace}/{githubProject}/issues/%s", "issue #%s"),
|
||||||
"ghpull": ("https://GitHub.com/pyTooling/Actions/pull/%s", "pull request #%s"),
|
"ghpull": (f"https://GitHub.com/{githubNamespace}/{githubProject}/pull/%s", "pull request #%s"),
|
||||||
"ghsrc": ("https://GitHub.com/pyTooling/Actions/blob/main/%s", None),
|
"ghsrc": (f"https://GitHub.com/{githubNamespace}/{githubProject}/blob/main/%s", None),
|
||||||
"wiki": ("https://en.wikipedia.org/wiki/%s", None),
|
"wiki": (f"https://en.wikipedia.org/wiki/%s", None),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -265,18 +258,53 @@ todo_link_only = True
|
|||||||
|
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Sphinx.Ext.Coverage
|
# sphinx-reports
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
coverage_show_missing_items = True
|
# report_unittest_testsuites = {
|
||||||
|
# "src": {
|
||||||
|
# "name": f"{pythonProject}",
|
||||||
|
# "xml_report": "../report/unit/unittest.xml",
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# report_codecov_packages = {
|
||||||
|
# "src": {
|
||||||
|
# "name": f"{pythonProject}",
|
||||||
|
# "json_report": "../report/coverage/coverage.json",
|
||||||
|
# "fail_below": 80,
|
||||||
|
# "levels": "default"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# report_doccov_packages = {
|
||||||
|
# "src": {
|
||||||
|
# "name": f"{pythonProject}",
|
||||||
|
# "directory": f"../{directoryName}",
|
||||||
|
# "fail_below": 80,
|
||||||
|
# "levels": "default"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Sphinx_Design
|
||||||
|
# ==============================================================================
|
||||||
|
# sd_fontawesome_latex = True
|
||||||
|
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# AutoAPI.Sphinx
|
# AutoAPI.Sphinx
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
autoapi_modules = {
|
autoapi_modules = {
|
||||||
"pyDummy": {
|
f"{pythonProject}": {
|
||||||
"template": "module",
|
"template": "package",
|
||||||
"output": "pyDummy",
|
"output": pythonProject,
|
||||||
"override": True
|
"override": True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for directory in [mod for mod in Path(f"../{directoryName}").iterdir() if mod.is_dir() and mod.name != "__pycache__"]:
|
||||||
|
print(f"Adding module rule for '{pythonProject}.{directory.name}'")
|
||||||
|
autoapi_modules[f"{pythonProject}.{directory.name}"] = {
|
||||||
|
"template": "module",
|
||||||
|
"output": pythonProject,
|
||||||
|
"override": True
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ Code Coverage Report
|
|||||||
|
|
||||||
Code coverage report generated with `pytest <https://github.com/pytest-dev/pytest>`__ and `Coverage.py <https://github.com/nedbat/coveragepy/tree/master>`__.
|
Code coverage report generated with `pytest <https://github.com/pytest-dev/pytest>`__ and `Coverage.py <https://github.com/nedbat/coveragepy/tree/master>`__.
|
||||||
|
|
||||||
.. report:code-coverage::
|
.. #report:code-coverage::
|
||||||
:packageid: src
|
:reportid: src
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ References
|
|||||||
|
|
||||||
- `hdl/containers#48 <https://github.com/hdl/containers/issues/48>`__
|
- `hdl/containers#48 <https://github.com/hdl/containers/issues/48>`__
|
||||||
|
|
||||||
|
|
||||||
|
.. _CONTRIBUTORS:
|
||||||
|
|
||||||
Contributors
|
Contributors
|
||||||
************
|
************
|
||||||
|
|
||||||
@@ -108,6 +111,8 @@ Contributors
|
|||||||
* `and more... <https://GitHub.com/pyTooling/Actions/graphs/contributors>`__
|
* `and more... <https://GitHub.com/pyTooling/Actions/graphs/contributors>`__
|
||||||
|
|
||||||
|
|
||||||
|
.. _LICENSE:
|
||||||
|
|
||||||
License
|
License
|
||||||
*******
|
*******
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ pushd %~dp0
|
|||||||
REM Command file for Sphinx documentation
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
if "%SPHINXBUILD%" == "" (
|
if "%SPHINXBUILD%" == "" (
|
||||||
set SPHINXBUILD=sphinx-build
|
set SPHINXBUILD=py -3.13 -m sphinx.cmd.build
|
||||||
)
|
)
|
||||||
set SOURCEDIR=.
|
set SOURCEDIR=.
|
||||||
set BUILDDIR=_build
|
set BUILDDIR=_build
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
-r ../requirements.txt
|
-r ../requirements.txt
|
||||||
|
|
||||||
pyTooling ~= 6.0
|
pyTooling ~= 8.5
|
||||||
|
|
||||||
# Enforce latest version on ReadTheDocs
|
# Enforce latest version on ReadTheDocs
|
||||||
sphinx >= 7.1, < 8.0
|
sphinx ~= 8.2
|
||||||
docutils >= 0.18.0, < 0.19.0
|
docutils ~= 0.21
|
||||||
|
docutils_stubs ~= 0.0.22
|
||||||
|
|
||||||
|
# ReadTheDocs Theme
|
||||||
|
sphinx_rtd_theme ~= 3.0
|
||||||
|
|
||||||
# Sphinx Extenstions
|
# Sphinx Extenstions
|
||||||
#sphinx.ext.coverage
|
sphinxcontrib-mermaid ~= 1.0
|
||||||
#sphinxcontrib-actdiag>=0.8.5
|
|
||||||
sphinxcontrib-mermaid>=0.9.2
|
|
||||||
#sphinxcontrib-seqdiag>=0.8.5
|
|
||||||
#sphinxcontrib-textstyle>=0.2.1
|
|
||||||
#sphinxcontrib-spelling>=2.2.0
|
|
||||||
autoapi >= 2.0.1
|
autoapi >= 2.0.1
|
||||||
sphinx_fontawesome >= 0.0.6
|
sphinx_design ~= 0.6.1
|
||||||
sphinx-inline-tabs >= 2023.4.21
|
sphinx-copybutton >= 0.5.2
|
||||||
sphinx_autodoc_typehints >= 1.24.0
|
sphinx_autodoc_typehints ~= 3.2
|
||||||
# changelog>=0.3.5
|
sphinx_reports ~= 0.9
|
||||||
|
|||||||
@@ -4,21 +4,21 @@
|
|||||||
# percent encoding so that the URL is properly parsed.
|
# percent encoding so that the URL is properly parsed.
|
||||||
|
|
||||||
.. # Sourcecode link to GitHub
|
.. # Sourcecode link to GitHub
|
||||||
.. |SHIELD:svg:pyTooling-github| image:: https://img.shields.io/badge/pyTooling-Actions-63bf7f.svg?longCache=true&style=flat-square&longCache=true&logo=GitHub
|
.. |SHIELD:svg:pyTooling-github| image:: https://img.shields.io/badge/pyTooling-Actions-63bf7f?longCache=true&style=flat-square&longCache=true&logo=GitHub
|
||||||
:alt: Sourcecode on GitHub
|
:alt: Sourcecode on GitHub
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: https://GitHub.com/pyTooling/pyTooling
|
:target: https://GitHub.com/pyTooling/Actions
|
||||||
.. |SHIELD:png:pyTooling-github| image:: https://raster.shields.io/badge/pyTooling-Actions-63bf7f.svg?longCache=true&style=flat-square&longCache=true&logo=GitHub
|
.. |SHIELD:png:pyTooling-github| image:: https://raster.shields.io/badge/pyTooling-Actions-63bf7f?longCache=true&style=flat-square&longCache=true&logo=GitHub
|
||||||
:alt: Sourcecode on GitHub
|
:alt: Sourcecode on GitHub
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: https://GitHub.com/pyTooling/pyTooling
|
:target: https://GitHub.com/pyTooling/Actions
|
||||||
|
|
||||||
.. # Sourcecode license
|
.. # Sourcecode license
|
||||||
.. |SHIELD:svg:pyTooling-src-license| image:: https://img.shields.io/pypi/l/pyTooling?longCache=true&style=flat-square&logo=Apache&label=code
|
.. |SHIELD:svg:pyTooling-src-license| image:: https://img.shields.io/pypi/l/pyTooling?longCache=true&style=flat-square&logo=Apache&label=code
|
||||||
:alt: Code license
|
:alt: Code license
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: Code-License.html
|
:target: Code-License.html
|
||||||
.. |SHIELD:png:pyTooling-src-license| image:: https://img.shields.io/pypi/l/pyTooling?longCache=true&style=flat-square&logo=Apache&label=code
|
.. |SHIELD:png:pyTooling-src-license| image:: https://raster.shields.io/pypi/l/pyTooling?longCache=true&style=flat-square&logo=Apache&label=code
|
||||||
:alt: Code license
|
:alt: Code license
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: https://GitHub.com/pyTooling/Actions/blob/main/LICENSE.md
|
:target: https://GitHub.com/pyTooling/Actions/blob/main/LICENSE.md
|
||||||
@@ -64,11 +64,11 @@
|
|||||||
:target: https://pyTooling.github.io/pyTooling/
|
:target: https://pyTooling.github.io/pyTooling/
|
||||||
|
|
||||||
.. # Gitter
|
.. # Gitter
|
||||||
.. |SHIELD:svg:pyTooling-gitter| image:: https://img.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef
|
.. |SHIELD:svg:pyTooling-gitter| image:: https://img.shields.io/badge/chat-on%20gitter-4db797?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef
|
||||||
:alt: Documentation License
|
:alt: Documentation License
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: https://gitter.im/hdl/community
|
:target: https://gitter.im/hdl/community
|
||||||
.. |SHIELD:png:pyTooling-gitter| image:: https://raster.shields.io/badge/chat-on%20gitter-4db797.svg?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef
|
.. |SHIELD:png:pyTooling-gitter| image:: https://raster.shields.io/badge/chat-on%20gitter-4db797?longCache=true&style=flat-square&logo=gitter&logoColor=e8ecef
|
||||||
:alt: Documentation License
|
:alt: Documentation License
|
||||||
:height: 22
|
:height: 22
|
||||||
:target: https://gitter.im/hdl/community
|
:target: https://gitter.im/hdl/community
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ Unittest Summary Report
|
|||||||
|
|
||||||
Unittest report generated with `pytest <https://github.com/pytest-dev/pytest>`__.
|
Unittest report generated with `pytest <https://github.com/pytest-dev/pytest>`__.
|
||||||
|
|
||||||
.. report:unittest-summary::
|
.. #report:unittest-summary::
|
||||||
:reportid: src
|
:reportid: src
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# #
|
# #
|
||||||
# License: #
|
# License: #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany #
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -34,9 +34,9 @@ A module for a set of dummy classes.
|
|||||||
|
|
||||||
__author__ = "Patrick Lehmann"
|
__author__ = "Patrick Lehmann"
|
||||||
__email__ = "Paebbels@gmail.com"
|
__email__ = "Paebbels@gmail.com"
|
||||||
__copyright__ = "2017-2024, Patrick Lehmann"
|
__copyright__ = "2017-2025, Patrick Lehmann"
|
||||||
__license__ = "Apache License, Version 2.0"
|
__license__ = "Apache License, Version 2.0"
|
||||||
__version__ = "0.4.4"
|
__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"
|
||||||
|
|
||||||
@@ -53,9 +53,9 @@ class Base:
|
|||||||
_value: int #: An internal value.
|
_value: int #: An internal value.
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""
|
# """
|
||||||
Initializes the base-class.
|
# Initializes the base-class.
|
||||||
"""
|
# """
|
||||||
self._value = 0
|
self._value = 0
|
||||||
|
|
||||||
@readonly
|
@readonly
|
||||||
@@ -75,9 +75,9 @@ class Application(Base):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""
|
# """
|
||||||
Initializes the dummy application.
|
# Initializes the dummy application.
|
||||||
"""
|
# """
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
platform = Platform()
|
platform = Platform()
|
||||||
|
|||||||
101
pyExamples/Extensions/__init__.py
Normal file
101
pyExamples/Extensions/__init__.py
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
# ==================================================================================================================== #
|
||||||
|
# _____ _ _ _ _ _ #
|
||||||
|
# _ __ _ |_ _|__ ___ | (_)_ __ __ _ / \ ___| |_(_) ___ _ __ ___ #
|
||||||
|
# | '_ \| | | || |/ _ \ / _ \| | | '_ \ / _` | / _ \ / __| __| |/ _ \| '_ \/ __| #
|
||||||
|
# | |_) | |_| || | (_) | (_) | | | | | | (_| |_ / ___ \ (__| |_| | (_) | | | \__ \ #
|
||||||
|
# | .__/ \__, ||_|\___/ \___/|_|_|_| |_|\__, (_)_/ \_\___|\__|_|\___/|_| |_|___/ #
|
||||||
|
# |_| |___/ |___/ #
|
||||||
|
# ==================================================================================================================== #
|
||||||
|
# Authors: #
|
||||||
|
# Patrick Lehmann #
|
||||||
|
# #
|
||||||
|
# License: #
|
||||||
|
# ==================================================================================================================== #
|
||||||
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
|
# #
|
||||||
|
# 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 #
|
||||||
|
# ==================================================================================================================== #
|
||||||
|
#
|
||||||
|
"""
|
||||||
|
A module for a set of dummy classes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
__author__ = "Patrick Lehmann"
|
||||||
|
__email__ = "Paebbels@gmail.com"
|
||||||
|
__copyright__ = "2017-2025, Patrick Lehmann"
|
||||||
|
__license__ = "Apache License, Version 2.0"
|
||||||
|
__version__ = "0.14.8"
|
||||||
|
__keywords__ = ["GitHub Actions"]
|
||||||
|
__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues"
|
||||||
|
|
||||||
|
from pyTooling.Decorators import export, readonly
|
||||||
|
from pyTooling.Platform import Platform
|
||||||
|
|
||||||
|
|
||||||
|
@export
|
||||||
|
class Base:
|
||||||
|
"""
|
||||||
|
A base-class for dummy applications.
|
||||||
|
"""
|
||||||
|
|
||||||
|
_value: int #: An internal value.
|
||||||
|
|
||||||
|
def __init__(self) -> None:
|
||||||
|
"""
|
||||||
|
Initializes the base-class.
|
||||||
|
"""
|
||||||
|
self._value = 0
|
||||||
|
|
||||||
|
@readonly
|
||||||
|
def Value(self) -> int:
|
||||||
|
"""
|
||||||
|
Read-only property to return the internal value.
|
||||||
|
|
||||||
|
:return: Internal value.
|
||||||
|
"""
|
||||||
|
return self._value
|
||||||
|
|
||||||
|
|
||||||
|
@export
|
||||||
|
class Application(Base):
|
||||||
|
"""
|
||||||
|
A dummy application for demonstration purposes.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self) -> None:
|
||||||
|
"""
|
||||||
|
Initializes the dummy application.
|
||||||
|
"""
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
platform = Platform()
|
||||||
|
if platform.IsNativeLinux:
|
||||||
|
self._value += 1
|
||||||
|
elif platform.IsNativeMacOS:
|
||||||
|
self._value += 2
|
||||||
|
elif platform.IsNativeWindows:
|
||||||
|
self._value += 3
|
||||||
|
elif platform.IsMSYSOnWindows:
|
||||||
|
self._value += 11
|
||||||
|
elif platform.IsMinGW32OnWindows:
|
||||||
|
self._value += 12
|
||||||
|
elif platform.IsMinGW64OnWindows:
|
||||||
|
self._value += 13
|
||||||
|
elif platform.IsUCRT64OnWindows:
|
||||||
|
self._value += 14
|
||||||
|
elif platform.IsClang32OnWindows:
|
||||||
|
self._value += 15
|
||||||
|
elif platform.IsClang64OnWindows:
|
||||||
|
self._value += 16
|
||||||
0
pyExamples/Extensions/py.typed
Normal file
0
pyExamples/Extensions/py.typed
Normal file
@@ -1,8 +1,8 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = [
|
requires = [
|
||||||
"setuptools >= 69.0.0",
|
"setuptools >= 80.0",
|
||||||
"wheel >= 0.40.0",
|
"wheel ~= 0.45",
|
||||||
"pyTooling ~= 6.0"
|
"pyTooling ~= 8.5"
|
||||||
]
|
]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
@@ -20,7 +20,14 @@ show_error_codes = true
|
|||||||
namespace_packages = true
|
namespace_packages = true
|
||||||
html_report = "report/typing"
|
html_report = "report/typing"
|
||||||
|
|
||||||
|
[tool.pytest]
|
||||||
|
junit_xml = "report/unit/UnittestReportSummary.xml"
|
||||||
|
|
||||||
|
[tool.pyedaa-reports]
|
||||||
|
junit_xml = "report/unit/unittest.xml"
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
|
addopts = "--tb=native"
|
||||||
# Don't set 'python_classes = *' otherwise, pytest doesn't search for classes
|
# Don't set 'python_classes = *' otherwise, pytest doesn't search for classes
|
||||||
# derived from unittest.Testcase
|
# derived from unittest.Testcase
|
||||||
python_files = "*"
|
python_files = "*"
|
||||||
@@ -29,6 +36,7 @@ filterwarnings = [
|
|||||||
"error::DeprecationWarning",
|
"error::DeprecationWarning",
|
||||||
"error::PendingDeprecationWarning"
|
"error::PendingDeprecationWarning"
|
||||||
]
|
]
|
||||||
|
junit_logging = "all"
|
||||||
|
|
||||||
[tool.interrogate]
|
[tool.interrogate]
|
||||||
color = true
|
color = true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.9-slim-bullseye
|
FROM python:3.12-slim-bookworm
|
||||||
COPY releaser.py /releaser.py
|
COPY releaser.py /releaser.py
|
||||||
RUN pip install PyGithub --progress-bar off \
|
RUN pip install PyGithub --progress-bar off \
|
||||||
&& apt update -qq \
|
&& apt update -qq \
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
mwe:
|
mwe:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# Clone repository
|
# Clone repository
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
# Build your application, tool, artifacts, etc.
|
# Build your application, tool, artifacts, etc.
|
||||||
- name: Build
|
- name: Build
|
||||||
@@ -156,7 +156,7 @@ For prototyping purposes, the following job might be useful:
|
|||||||
```yml
|
```yml
|
||||||
Release:
|
Release:
|
||||||
name: '📦 Release'
|
name: '📦 Release'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
needs:
|
needs:
|
||||||
- ...
|
- ...
|
||||||
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
|
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/'))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -45,7 +45,9 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: pip install --disable-pip-version-check PyGithub --progress-bar off
|
run: |
|
||||||
|
[ "$(source /etc/os-release && echo $VERSION_ID)" == "24.04" ] && UBUNTU_2404_ARGS='--break-system-packages' || unset UBUNTU_2404_ARGS
|
||||||
|
pip install --disable-pip-version-check --progress-bar off $UBUNTU_2404_ARGS PyGithub
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: '''${{ github.action_path }}/../releaser.py'''
|
run: '''${{ github.action_path }}/../releaser.py'''
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
pyTooling ~= 6.0
|
pyTooling ~= 8.5
|
||||||
|
|||||||
316
run.ps1
Normal file
316
run.ps1
Normal file
@@ -0,0 +1,316 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
Param(
|
||||||
|
# Clean up all files and directories
|
||||||
|
[switch]$clean,
|
||||||
|
|
||||||
|
# Commands
|
||||||
|
[switch]$all,
|
||||||
|
[switch]$copyall,
|
||||||
|
|
||||||
|
[switch]$doc,
|
||||||
|
[switch]$livedoc,
|
||||||
|
[switch]$doccov,
|
||||||
|
|
||||||
|
[switch]$unit,
|
||||||
|
[switch]$liveunit,
|
||||||
|
[switch]$copyunit,
|
||||||
|
|
||||||
|
[switch]$cov,
|
||||||
|
[switch]$livecov,
|
||||||
|
[switch]$copycov,
|
||||||
|
|
||||||
|
[switch]$type,
|
||||||
|
[switch]$livetype,
|
||||||
|
[switch]$copytype,
|
||||||
|
|
||||||
|
[switch]$nooutput,
|
||||||
|
|
||||||
|
[switch]$build,
|
||||||
|
[switch]$install,
|
||||||
|
|
||||||
|
# Display this help"
|
||||||
|
[switch]$help
|
||||||
|
)
|
||||||
|
|
||||||
|
$PackageName = "Actions"
|
||||||
|
|
||||||
|
# set default values
|
||||||
|
$EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"]
|
||||||
|
$EnableVerbose = [bool]$PSCmdlet.MyInvocation.BoundParameters["Verbose"] -or $EnableDebug
|
||||||
|
|
||||||
|
# Display help if no command was selected
|
||||||
|
$help = $help -or ( -not(
|
||||||
|
$all -or $copyall -or
|
||||||
|
$clean -or
|
||||||
|
$doc -or $livedoc -or $doccov -or
|
||||||
|
$unit -or $liveunit -or $copyunit -or
|
||||||
|
$cov -or $livecov -or $copycov -or
|
||||||
|
$type -or $livetype -or $copytype -or
|
||||||
|
$build -or $install
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Host "================================================================================" -ForegroundColor Magenta
|
||||||
|
Write-Host "$PackageName Documentation Compilation and Assembly Tool" -ForegroundColor Magenta
|
||||||
|
Write-Host "================================================================================" -ForegroundColor Magenta
|
||||||
|
|
||||||
|
if ($help)
|
||||||
|
{ Get-Help $MYINVOCATION.MyCommand.Path -Detailed
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($all)
|
||||||
|
{ $doc = $true
|
||||||
|
$unit = $true
|
||||||
|
# $copyunit = $true
|
||||||
|
$cov = $true
|
||||||
|
# $copycov = $true
|
||||||
|
$type = $true
|
||||||
|
$copytype = $true
|
||||||
|
}
|
||||||
|
if ($copyall)
|
||||||
|
{# $copyunit = $true
|
||||||
|
# $copycov = $true
|
||||||
|
$copytype = $true
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($clean)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "[live][DOC] Cleaning documentation directories ..."
|
||||||
|
rm -Force .\doc\$PackageName\*
|
||||||
|
.\doc\make.bat clean
|
||||||
|
Write-Host -ForegroundColor DarkYellow "[live][BUILD] Cleaning build directories ..."
|
||||||
|
rm -Force .\build\bdist.win-amd64
|
||||||
|
rm -Force .\build\lib
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($build)
|
||||||
|
{ Write-Host -ForegroundColor Yellow "[live][BUILD] Cleaning build directories ..."
|
||||||
|
rm -Force .\build\bdist.win-amd64
|
||||||
|
rm -Force .\build\lib
|
||||||
|
Write-Host -ForegroundColor Yellow "[live][BUILD] Building $PackageName package as wheel ..."
|
||||||
|
py -3.13 -m build --wheel --no-isolation
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor Yellow "[live][BUILD] Building wheel finished"
|
||||||
|
}
|
||||||
|
if ($install)
|
||||||
|
{ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
|
||||||
|
{ Write-Host -ForegroundColor Yellow "[live][INSTALL] Installing $PackageName with administrator rights ..."
|
||||||
|
$proc = Start-Process pwsh.exe "-NoProfile -ExecutionPolicy Bypass -WorkingDirectory `"$PSScriptRoot`" -File `"$PSCommandPath`" `"-install`"" -Verb RunAs -Wait
|
||||||
|
|
||||||
|
# Write-Host -ForegroundColor Yellow "[live][INSTALL] Wait on administrator console ..."
|
||||||
|
# Wait-Process -Id $proc.Id
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ Write-Host -ForegroundColor Cyan "[ADMIN][UNINSTALL] Uninstalling $PackageName ..."
|
||||||
|
py -3.13 -m pip uninstall -y $PackageName
|
||||||
|
Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Installing $PackageName from wheel ..."
|
||||||
|
py -3.13 -m pip install .\dist\$PackageName-8.1.0-py3-none-any.whl
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor Cyan "[ADMIN][INSTALL] Closing window in 5 seconds ..."
|
||||||
|
Start-Sleep -Seconds 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$jobs = @()
|
||||||
|
|
||||||
|
if ($livedoc)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "[live][DOC] Building documentation using Sphinx ..."
|
||||||
|
|
||||||
|
.\doc\make.bat html --verbose
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkYellow "[live][DOC] Documentation finished"
|
||||||
|
}
|
||||||
|
elseif ($doc)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "[Job1][DOC] Building documentation using Sphinx ..."
|
||||||
|
Write-Host -ForegroundColor DarkGreen "[SCRIPT] Starting Documentation job ..."
|
||||||
|
|
||||||
|
# Compile documentation
|
||||||
|
$compileDocFunc = {
|
||||||
|
.\doc\make.bat html --verbose
|
||||||
|
}
|
||||||
|
$docJob = Start-Job -Name "Documentation" -ScriptBlock $compileDocFunc
|
||||||
|
# $jobs += $docJob
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($doccov)
|
||||||
|
{
|
||||||
|
.\doc\make.bat coverage
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($liveunit)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "[live][UNIT] Running Unit Tests using pytest ..."
|
||||||
|
|
||||||
|
$env:ENVIRONMENT_NAME = "Windows (x86-64)"
|
||||||
|
pytest -raP --color=yes --junitxml=report/unit/unittest.xml --template=html1/index.html --report=report/unit/html/index.html --split-report tests/unit
|
||||||
|
|
||||||
|
if ($copyunit)
|
||||||
|
{ cp -Recurse -Force .\report\unit\html\* .\doc\_build\html\unittests
|
||||||
|
Write-Host -ForegroundColor DarkBlue "[live][UNIT] Copyed unit testing report to 'unittests' directory in HTML directory"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkYellow "[live][UNIT] Unit Tests finished"
|
||||||
|
}
|
||||||
|
elseif ($unit)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "[Job2][UNIT] Running Unit Tests using pytest ..."
|
||||||
|
Write-Host -ForegroundColor DarkGreen "[SCRIPT] Starting UnitTests jobs ..."
|
||||||
|
|
||||||
|
# Run unit tests
|
||||||
|
$runUnitFunc = {
|
||||||
|
$env:ENVIRONMENT_NAME = "Windows (x86-64)"
|
||||||
|
pytest -raP --color=yes --junitxml=report/unit/unittest.xml --template=html1/index.html --report=report/unit/html/index.html --split-report tests/unit
|
||||||
|
}
|
||||||
|
$unitJob = Start-Job -Name "UnitTests" -ScriptBlock $runUnitFunc
|
||||||
|
$jobs += $unitJob
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($livecov)
|
||||||
|
{ Write-Host -ForegroundColor DarkMagenta "[live][COV] Running Unit Tests with coverage ..."
|
||||||
|
|
||||||
|
$env:ENVIRONMENT_NAME = "Windows (x86-64)"
|
||||||
|
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -ra --tb=line --color=yes tests/unit
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to HTML ..."
|
||||||
|
coverage html
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to XML (Cobertura) ..."
|
||||||
|
coverage xml
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Convert coverage report to JSON ..."
|
||||||
|
coverage json
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Write coverage report to console ..."
|
||||||
|
coverage report
|
||||||
|
|
||||||
|
if ($copycov)
|
||||||
|
{ cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Copyed code coverage report to 'coverage' directory in HTML directory"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[live][COV] Coverage finished"
|
||||||
|
}
|
||||||
|
elseif ($cov)
|
||||||
|
{ Write-Host -ForegroundColor DarkMagenta "[live][COV] Running Unit Tests with coverage ..."
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[SCRIPT] Starting Coverage jobs ..."
|
||||||
|
|
||||||
|
# Collect coverage
|
||||||
|
$collectCovFunc = {
|
||||||
|
$env:ENVIRONMENT_NAME = "Windows (x86-64)"
|
||||||
|
coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -ra --tb=line --color=yes tests/unit
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to HTML ..."
|
||||||
|
coverage html
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to XML (Cobertura) ..."
|
||||||
|
coverage xml
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[Job3][COV] Convert coverage report to JSON ..."
|
||||||
|
coverage json
|
||||||
|
}
|
||||||
|
$covJob = Start-Job -Name "Coverage" -ScriptBlock $collectCovFunc
|
||||||
|
$jobs += $covJob
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($livetype)
|
||||||
|
{ Write-Host -ForegroundColor DarkCyan "[live][TYPE] Running static type analysis using mypy ..."
|
||||||
|
|
||||||
|
$env:MYPY_FORCE_COLOR = 1
|
||||||
|
mypy.exe -p $PackageName
|
||||||
|
|
||||||
|
if ($copytype)
|
||||||
|
{ cp -Recurse -Force .\report\typing\* .\doc\_build\html\typing
|
||||||
|
Write-Host -ForegroundColor DarkCyan "[live][TYPE] Copyed typing report to 'typing' directory in HTML directory."
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor DarkCyan "[live][TYPE] Static type analysis finished"
|
||||||
|
}
|
||||||
|
elseif ($type)
|
||||||
|
{ Write-Host -ForegroundColor DarkCyan "[live][TYPE] Running static type analysis using mypy ..."
|
||||||
|
Write-Host -ForegroundColor DarkCyan "[SCRIPT] Starting Typing jobs ..."
|
||||||
|
|
||||||
|
# Analyze types
|
||||||
|
$analyzeTypesFunc = {
|
||||||
|
$env:MYPY_FORCE_COLOR = 1
|
||||||
|
mypy.exe -p $PackageName
|
||||||
|
}
|
||||||
|
$typeJob = Start-Job -Name "Typing" -ScriptBlock $analyzeTypesFunc
|
||||||
|
$jobs += $typeJob
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($doc)
|
||||||
|
{ Write-Host -ForegroundColor DarkGreen "[SCRIPT] Waiting on Documentation job ..."
|
||||||
|
Wait-Job -Job $docJob
|
||||||
|
Write-Host -ForegroundColor DarkYellow "[Job1][DOC] Documentation finished"
|
||||||
|
}
|
||||||
|
if ($jobs.Count -ne 0)
|
||||||
|
{
|
||||||
|
Write-Host -ForegroundColor DarkGreen ( "[SCRIPT] Waiting on {0} jobs ({1}) ..." -f $jobs.Count, (($jobs | %{ $_.Name }) -join ", "))
|
||||||
|
Wait-Job -Job $jobs
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (-not $liveunit -and $copyunit)
|
||||||
|
{
|
||||||
|
# if ($unit)
|
||||||
|
# { Wait-Job -Job $unitJob
|
||||||
|
# Write-Host -ForegroundColor DarkBlue "[Job2][UNIT] Unit tests finished"
|
||||||
|
# }
|
||||||
|
cp -Recurse -Force .\report\unit\html\* .\doc\_build\html\unittests
|
||||||
|
Write-Host -ForegroundColor DarkBlue "[post][UNIT] Copyed unit testing report to 'unittests' directory in HTML directory"
|
||||||
|
}
|
||||||
|
if (-not ($livecov -or $cov) -and $copycov)
|
||||||
|
{
|
||||||
|
# if ($cov)
|
||||||
|
# { Wait-Job -Job $unitJob
|
||||||
|
# Write-Host -ForegroundColor DarkMagenta "[Job3][UNIT] Coverage collection finished"
|
||||||
|
# }
|
||||||
|
cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[post][COV] Copyed code coverage report to 'coverage' directory in HTML directory"
|
||||||
|
}
|
||||||
|
if (-not $livetype -and $copytype)
|
||||||
|
{
|
||||||
|
# if ($type)
|
||||||
|
# { Wait-Job -Job $typeJob
|
||||||
|
# Write-Host -ForegroundColor DarkCyan "[Job4][UNIT] Static type analysis finished"
|
||||||
|
# }
|
||||||
|
cp -Recurse -Force .\report\typing\* .\doc\_build\html\typing
|
||||||
|
Write-Host -ForegroundColor DarkCyan "[post][TYPE] Copyed typing report to 'typing' directory in HTML directory."
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($type)
|
||||||
|
{ Write-Host -ForegroundColor DarkCyan "================================================================================"
|
||||||
|
if (-not $nooutput)
|
||||||
|
{ Receive-Job -Job $typeJob
|
||||||
|
}
|
||||||
|
Remove-Job -Job $typeJob
|
||||||
|
}
|
||||||
|
if ($doc)
|
||||||
|
{ Write-Host -ForegroundColor DarkYellow "================================================================================"
|
||||||
|
if (-not $nooutput)
|
||||||
|
{ Receive-Job -Job $docJob
|
||||||
|
}
|
||||||
|
Remove-Job -Job $docJob
|
||||||
|
}
|
||||||
|
if ($unit)
|
||||||
|
{ Write-Host -ForegroundColor DarkBlue "================================================================================"
|
||||||
|
if (-not $nooutput)
|
||||||
|
{ Receive-Job -Job $unitJob
|
||||||
|
}
|
||||||
|
Remove-Job -Job $unitJob
|
||||||
|
}
|
||||||
|
if ($cov)
|
||||||
|
{ Write-Host -ForegroundColor DarkMagenta "================================================================================"
|
||||||
|
if (-not $nooutput)
|
||||||
|
{ Receive-Job -Job $covJob
|
||||||
|
}
|
||||||
|
Remove-Job -Job $covJob
|
||||||
|
|
||||||
|
if ($copycov)
|
||||||
|
{ cp -Recurse -Force .\report\coverage\html\* .\doc\_build\html\coverage
|
||||||
|
Write-Host -ForegroundColor DarkMagenta "[post][COV] Copyed code coverage report to 'coverage' directory in HTML directory"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Write-Host -ForegroundColor DarkGreen "================================================================================"
|
||||||
|
Write-Host -ForegroundColor DarkGreen "[SCRIPT] Finished"
|
||||||
25
setup.py
25
setup.py
@@ -11,7 +11,7 @@
|
|||||||
# #
|
# #
|
||||||
# License: #
|
# License: #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany #
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -39,13 +39,16 @@ packageName = "pyDummy"
|
|||||||
packageDirectory = packageName
|
packageDirectory = packageName
|
||||||
packageInformationFile = Path(f"{packageDirectory}/__init__.py")
|
packageInformationFile = Path(f"{packageDirectory}/__init__.py")
|
||||||
|
|
||||||
setup(**DescribePythonPackageHostedOnGitHub(
|
setup(
|
||||||
packageName=packageName,
|
**DescribePythonPackageHostedOnGitHub(
|
||||||
description="pyDummy is a test package to verify GitHub actions for Python projects.",
|
packageName=packageName,
|
||||||
gitHubNamespace=gitHubNamespace,
|
description="pyDummy is a test package to verify GitHub actions for Python projects.",
|
||||||
unittestRequirementsFile=Path("tests/requirements.txt"),
|
gitHubNamespace=gitHubNamespace,
|
||||||
sourceFileWithVersion=packageInformationFile,
|
unittestRequirementsFile=Path("tests/requirements.txt"),
|
||||||
dataFiles={
|
sourceFileWithVersion=packageInformationFile,
|
||||||
packageName: ["py.typed"]
|
dataFiles={
|
||||||
}
|
packageName: ["py.typed"]
|
||||||
))
|
},
|
||||||
|
debug=True
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|||||||
91
tests/pacman_packages.py
Normal file
91
tests/pacman_packages.py
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
from os import getenv
|
||||||
|
from pathlib import Path
|
||||||
|
from re import compile
|
||||||
|
from sys import version
|
||||||
|
|
||||||
|
print(f"Python: {version}")
|
||||||
|
|
||||||
|
|
||||||
|
def loadRequirementsFile(requirementsFile: Path):
|
||||||
|
requirements = []
|
||||||
|
with requirementsFile.open("r", encoding="utf-8") as file:
|
||||||
|
for line in file.readlines():
|
||||||
|
line = line.strip()
|
||||||
|
if line.startswith("#") or line.startswith("https") or line == "":
|
||||||
|
continue
|
||||||
|
elif line.startswith("-r"):
|
||||||
|
# Remove the first word/argument (-r)
|
||||||
|
requirements += loadRequirementsFile(requirementsFile.parent / line[2:].lstrip())
|
||||||
|
else:
|
||||||
|
requirements.append(line)
|
||||||
|
|
||||||
|
return requirements
|
||||||
|
|
||||||
|
|
||||||
|
requirements = "-r ../tests/requirements.txt"
|
||||||
|
if requirements.startswith("-r"):
|
||||||
|
requirementsFile = Path(requirements[2:].lstrip())
|
||||||
|
try:
|
||||||
|
dependencies = loadRequirementsFile(requirementsFile)
|
||||||
|
except FileNotFoundError as ex:
|
||||||
|
print(f"::error title=FileNotFound::{ex}")
|
||||||
|
exit(1)
|
||||||
|
else:
|
||||||
|
dependencies = [req.strip() for req in requirements.split(" ")]
|
||||||
|
|
||||||
|
packages = {
|
||||||
|
"coverage": "python-coverage:p",
|
||||||
|
"igraph": "igraph:p",
|
||||||
|
"jinja2": "python-markupsafe:p",
|
||||||
|
"lxml": "python-lxml:p",
|
||||||
|
"numpy": "python-numpy:p",
|
||||||
|
"markupsafe": "python-markupsafe:p",
|
||||||
|
"pip": "python-pip:p",
|
||||||
|
"ruamel.yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
|
"sphinx": "python-markupsafe:p",
|
||||||
|
"tomli": "python-tomli:p",
|
||||||
|
"wheel": "python-wheel:p",
|
||||||
|
"pyEDAA.ProjectModel": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
"pyEDAA.Reports": "python-ruamel-yaml:p python-ruamel.yaml.clib:p python-lxml:p",
|
||||||
|
}
|
||||||
|
subPackages = {
|
||||||
|
"pytooling": {
|
||||||
|
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
regExp = compile(
|
||||||
|
r"(?P<PackageName>[\w_\-\.]+)(?:\[(?P<SubPackages>(?:\w+)(?:\s*,\s*\w+)*)\])?(?:\s*(?P<Comperator>[<>~=]+)\s*)(?P<Version>\d+(?:\.\d+)*)(?:-(?P<VersionExtension>\w+))?")
|
||||||
|
|
||||||
|
pacboyPackages = set(("python-pip:p", "python-wheel:p", "python-tomli:p"))
|
||||||
|
print(f"Processing dependencies ({len(dependencies)}):")
|
||||||
|
for dependency in dependencies:
|
||||||
|
print(f" {dependency}")
|
||||||
|
|
||||||
|
match = regExp.match(dependency.lower())
|
||||||
|
if not match:
|
||||||
|
print(f" Wrong format: {dependency}")
|
||||||
|
print(f"::error title=Identifying Pacboy Packages::Unrecognized dependency format '{dependency}'")
|
||||||
|
continue
|
||||||
|
|
||||||
|
package = match["PackageName"]
|
||||||
|
if package in packages:
|
||||||
|
rewrite = packages[package]
|
||||||
|
print(f" Found rewrite rule for '{package}': {rewrite}")
|
||||||
|
pacboyPackages.add(rewrite)
|
||||||
|
|
||||||
|
if match["SubPackages"] and package in subPackages:
|
||||||
|
for subPackage in match["SubPackages"].split(","):
|
||||||
|
if subPackage in subPackages[package]:
|
||||||
|
rewrite = subPackages[package][subPackage]
|
||||||
|
print(f" Found rewrite rule for '{package}[..., {subPackage}, ...]': {rewrite}")
|
||||||
|
pacboyPackages.add(rewrite)
|
||||||
|
|
||||||
|
# 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(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
||||||
|
|
||||||
|
print(f"GITHUB_OUTPUT:")
|
||||||
|
print(f"pacboy_packages={' '.join(pacboyPackages)}\n")
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
# #
|
# #
|
||||||
# License: #
|
# License: #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany #
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -28,12 +28,12 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0 #
|
# SPDX-License-Identifier: Apache-2.0 #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
#
|
#
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from pytest import mark
|
from pytest import mark
|
||||||
from pyTooling.Common import CurrentPlatform
|
from pyTooling.Platform import CurrentPlatform
|
||||||
|
|
||||||
from pyDummy import Application
|
from pyDummy import Application
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__": # pragma: no cover
|
if __name__ == "__main__": # pragma: no cover
|
||||||
|
|||||||
216
tests/python_jobs.py
Normal file
216
tests/python_jobs.py
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
from json import dumps as json_dumps
|
||||||
|
from os import getenv
|
||||||
|
from pathlib import Path
|
||||||
|
from textwrap import dedent
|
||||||
|
from typing import Iterable
|
||||||
|
|
||||||
|
name = "example".strip()
|
||||||
|
python_version = "3.12".strip()
|
||||||
|
systems = "ubuntu windows macos-arm mingw64 ucrt64".strip()
|
||||||
|
versions = "3.8 3.9 3.10 3.11 3.12".strip()
|
||||||
|
include_list = "".strip()
|
||||||
|
exclude_list = "".strip()
|
||||||
|
disable_list = "".strip()
|
||||||
|
|
||||||
|
currentMSYS2Version = "3.11"
|
||||||
|
currentAlphaVersion = "3.13"
|
||||||
|
currentAlphaRelease = "3.13.0-alpha.1"
|
||||||
|
|
||||||
|
if systems == "":
|
||||||
|
print("::error title=Parameter::system_list is empty.")
|
||||||
|
else:
|
||||||
|
systems = [sys.strip() for sys in systems.split(" ")]
|
||||||
|
|
||||||
|
if versions == "":
|
||||||
|
versions = [python_version]
|
||||||
|
else:
|
||||||
|
versions = [ver.strip() for ver in versions.split(" ")]
|
||||||
|
|
||||||
|
if include_list == "":
|
||||||
|
includes = []
|
||||||
|
else:
|
||||||
|
includes = [tuple(include.strip().split(":")) for include in include_list.split(" ")]
|
||||||
|
|
||||||
|
if exclude_list == "":
|
||||||
|
excludes = []
|
||||||
|
else:
|
||||||
|
excludes = [exclude.strip() for exclude in exclude_list.split(" ")]
|
||||||
|
|
||||||
|
if disable_list == "":
|
||||||
|
disabled = []
|
||||||
|
else:
|
||||||
|
disabled = [disable.strip() for disable in disable_list.split(" ")]
|
||||||
|
|
||||||
|
if "3.7" in versions:
|
||||||
|
print("::warning title=Deprecated::Support for Python 3.7 ended in 2023.06.27.")
|
||||||
|
if "msys2" in systems:
|
||||||
|
print("::warning title=Deprecated::System 'msys2' will be replaced by 'mingw64'.")
|
||||||
|
if currentAlphaVersion in versions:
|
||||||
|
print(f"::notice title=Experimental::Python {currentAlphaVersion} ({currentAlphaRelease}) is a pre-release.")
|
||||||
|
for disable in disabled:
|
||||||
|
print(f"::warning title=Disabled Python Job::System '{disable}' temporarily disabled.")
|
||||||
|
|
||||||
|
# see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
|
||||||
|
data = {
|
||||||
|
# Python and PyPy versions supported by "setup-python" action
|
||||||
|
"python": {
|
||||||
|
"3.7": {"icon": "⚫", "until": "2023.06.27"},
|
||||||
|
"3.8": {"icon": "🔴", "until": "2024.10"},
|
||||||
|
"3.9": {"icon": "🟠", "until": "2025.10"},
|
||||||
|
"3.10": {"icon": "🟡", "until": "2026.10"},
|
||||||
|
"3.11": {"icon": "🟢", "until": "2027.10"},
|
||||||
|
"3.12": {"icon": "🟢", "until": "2028.10"},
|
||||||
|
# "3.13": { "icon": "🟣", "until": "2028.10" },
|
||||||
|
"pypy-3.7": {"icon": "⟲⚫", "until": "????.??"},
|
||||||
|
"pypy-3.8": {"icon": "⟲🔴", "until": "????.??"},
|
||||||
|
"pypy-3.9": {"icon": "⟲🟠", "until": "????.??"},
|
||||||
|
"pypy-3.10": {"icon": "⟲🟡", "until": "????.??"},
|
||||||
|
},
|
||||||
|
# Runner systems (runner images) supported by GitHub Actions
|
||||||
|
"sys": {
|
||||||
|
"ubuntu": {"icon": "🐧", "runs-on": "ubuntu-24.04", "shell": "bash", "name": "Linux (x86-64)"},
|
||||||
|
"windows": {"icon": "🪟", "runs-on": "windows-latest", "shell": "pwsh", "name": "Windows (x86-64)"},
|
||||||
|
"macos": {"icon": "🍎", "runs-on": "macos-latest-large", "shell": "bash", "name": "macOS (x86-64)"},
|
||||||
|
"macos-arm": {"icon": "🍏", "runs-on": "macos-latest", "shell": "bash", "name": "macOS (aarch64)"},
|
||||||
|
},
|
||||||
|
# Runtimes provided by MSYS2
|
||||||
|
"runtime": {
|
||||||
|
"msys": {"icon": "🪟🟪", "name": "Windows+MSYS2 (x86-64) - MSYS"},
|
||||||
|
"mingw32": {"icon": "🪟⬛", "name": "Windows+MSYS2 (x86-64) - MinGW32"},
|
||||||
|
"mingw64": {"icon": "🪟🟦", "name": "Windows+MSYS2 (x86-64) - MinGW64"},
|
||||||
|
"clang32": {"icon": "🪟🟫", "name": "Windows+MSYS2 (x86-64) - Clang32"},
|
||||||
|
"clang64": {"icon": "🪟🟧", "name": "Windows+MSYS2 (x86-64) - Clang64"},
|
||||||
|
"ucrt64": {"icon": "🪟🟨", "name": "Windows+MSYS2 (x86-64) - UCRT64"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print(f"includes ({len(includes)}):")
|
||||||
|
for system, version in includes:
|
||||||
|
print(f"- {system}:{version}")
|
||||||
|
print(f"excludes ({len(excludes)}):")
|
||||||
|
for exclude in excludes:
|
||||||
|
print(f"- {exclude}")
|
||||||
|
print(f"disabled ({len(disabled)}):")
|
||||||
|
for disable in disabled:
|
||||||
|
print(f"- {disable}")
|
||||||
|
|
||||||
|
|
||||||
|
def match(combination: str, pattern: str) -> bool:
|
||||||
|
system, version = combination.split(":")
|
||||||
|
sys, ver = pattern.split(":")
|
||||||
|
|
||||||
|
if sys == "*":
|
||||||
|
return (ver == "*") or (version == ver)
|
||||||
|
elif system == sys:
|
||||||
|
return (ver == "*") or (version == ver)
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def notIn(combination: str, patterns: Iterable[str]) -> bool:
|
||||||
|
for pattern in patterns:
|
||||||
|
if match(combination, pattern):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
combinations = [
|
||||||
|
(system, version)
|
||||||
|
for system in systems
|
||||||
|
if system in data["sys"]
|
||||||
|
for version in versions
|
||||||
|
if version in data["python"]
|
||||||
|
and notIn(f"{system}:{version}", excludes)
|
||||||
|
and notIn(f"{system}:{version}", disabled)
|
||||||
|
] + [
|
||||||
|
(system, currentMSYS2Version)
|
||||||
|
for system in systems
|
||||||
|
if system in data["runtime"]
|
||||||
|
and notIn(f"{system}:{currentMSYS2Version}", excludes)
|
||||||
|
and notIn(f"{system}:{currentMSYS2Version}", disabled)
|
||||||
|
] + [
|
||||||
|
(system, version)
|
||||||
|
for system, version in includes
|
||||||
|
if system in data["sys"]
|
||||||
|
and version in data["python"]
|
||||||
|
and notIn(f"{system}:{version}", disabled)
|
||||||
|
]
|
||||||
|
print(f"Combinations ({len(combinations)}):")
|
||||||
|
for system, version in combinations:
|
||||||
|
print(f"- {system}:{version}")
|
||||||
|
|
||||||
|
jobs = [
|
||||||
|
{
|
||||||
|
"sysicon": data["sys"][system]["icon"],
|
||||||
|
"system": system,
|
||||||
|
"runs-on": data["sys"][system]["runs-on"],
|
||||||
|
"runtime": "native",
|
||||||
|
"shell": data["sys"][system]["shell"],
|
||||||
|
"pyicon": data["python"][version]["icon"],
|
||||||
|
"python": currentAlphaRelease if version == currentAlphaVersion else version,
|
||||||
|
"envname": data["sys"][system]["name"],
|
||||||
|
}
|
||||||
|
for system, version in combinations if system in data["sys"]
|
||||||
|
] + [
|
||||||
|
{
|
||||||
|
"sysicon": data["runtime"][runtime]["icon"],
|
||||||
|
"system": "msys2",
|
||||||
|
"runs-on": "windows-latest",
|
||||||
|
"runtime": runtime.upper(),
|
||||||
|
"shell": "msys2 {0}",
|
||||||
|
"pyicon": data["python"][currentMSYS2Version]["icon"],
|
||||||
|
"python": version,
|
||||||
|
"envname": data["runtime"][runtime]["name"],
|
||||||
|
}
|
||||||
|
for runtime, version in combinations if runtime not in data["sys"]
|
||||||
|
]
|
||||||
|
|
||||||
|
artifact_names = {
|
||||||
|
"unittesting_xml": f"{name}-UnitTestReportSummary-XML",
|
||||||
|
"unittesting_html": f"{name}-UnitTestReportSummary-HTML",
|
||||||
|
"perftesting_xml": f"{name}-PerformanceTestReportSummary-XML",
|
||||||
|
"benchtesting_xml": f"{name}-BenchmarkTestReportSummary-XML",
|
||||||
|
"apptesting_xml": f"{name}-ApplicationTestReportSummary-XML",
|
||||||
|
"codecoverage_sqlite": f"{name}-CodeCoverage-SQLite",
|
||||||
|
"codecoverage_xml": f"{name}-CodeCoverage-XML",
|
||||||
|
"codecoverage_json": f"{name}-CodeCoverage-JSON",
|
||||||
|
"codecoverage_html": f"{name}-CodeCoverage-HTML",
|
||||||
|
"statictyping_html": f"{name}-StaticTyping-HTML",
|
||||||
|
"package_all": f"{name}-Packages",
|
||||||
|
"documentation_html": f"{name}-Documentation-HTML",
|
||||||
|
"documentation_latex": f"{name}-Documentation-LaTeX",
|
||||||
|
"documentation_pdf": f"{name}-Documentation-PDF",
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deprecated structure
|
||||||
|
params = {
|
||||||
|
"python_version": python_version,
|
||||||
|
"artifacts": {
|
||||||
|
"unittesting": f"{artifact_names['unittesting_xml']}",
|
||||||
|
"coverage": f"{artifact_names['codecoverage_html']}",
|
||||||
|
"typing": f"{artifact_names['statictyping_html']}",
|
||||||
|
"package": f"{artifact_names['package_all']}",
|
||||||
|
"doc": f"{artifact_names['documentation_html']}",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print("Parameters:")
|
||||||
|
print(f" python_version: {python_version}")
|
||||||
|
print(f" python_jobs ({len(jobs)}):\n" +
|
||||||
|
"".join(
|
||||||
|
[f" {{ " + ", ".join([f"\"{key}\": \"{value}\"" for key, value in job.items()]) + f" }},\n" for job in jobs])
|
||||||
|
)
|
||||||
|
print(f" artifact_names ({len(artifact_names)}):")
|
||||||
|
for id, name in artifact_names.items():
|
||||||
|
print(f" {id:>20}: {name}")
|
||||||
|
|
||||||
|
# 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"""\
|
||||||
|
python_version={python_version}
|
||||||
|
python_jobs={json_dumps(jobs)}
|
||||||
|
artifact_names={json_dumps(artifact_names)}
|
||||||
|
params={json_dumps(params)}
|
||||||
|
"""))
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
-r ../requirements.txt
|
-r ../requirements.txt
|
||||||
|
|
||||||
# Coverage collection
|
# Coverage collection
|
||||||
Coverage >= 7.4
|
Coverage ~= 7.10
|
||||||
|
|
||||||
# Test Runner
|
# Test Runner
|
||||||
pytest >= 7.4.0
|
pytest ~= 8.4
|
||||||
pytest-cov >= 4.1.0
|
pytest-cov ~= 6.2
|
||||||
|
|
||||||
# Static Type Checking
|
# Static Type Checking
|
||||||
mypy >= 1.8.0
|
mypy ~= 1.17
|
||||||
typing_extensions >= 4.9.0
|
typing_extensions ~= 4.14
|
||||||
lxml >= 5.0
|
lxml ~= 6.0
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# #
|
# #
|
||||||
# License: #
|
# License: #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany #
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# #
|
# #
|
||||||
# License: #
|
# License: #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany #
|
# Copyright 2017-2025 Patrick Lehmann - Bötzingen, Germany #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# Unai Martinez-Corral #
|
# Unai Martinez-Corral #
|
||||||
# #
|
# #
|
||||||
# ==================================================================================================================== #
|
# ==================================================================================================================== #
|
||||||
# Copyright 2020-2024 The pyTooling Authors #
|
# Copyright 2020-2025 The pyTooling Authors #
|
||||||
# #
|
# #
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
# Licensed under the Apache License, Version 2.0 (the "License"); #
|
||||||
# you may not use this file except in compliance with the License. #
|
# you may not use this file except in compliance with the License. #
|
||||||
@@ -37,6 +37,6 @@ inputs:
|
|||||||
default: POST
|
default: POST
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'main.js'
|
main: 'main.js'
|
||||||
post: 'main.js'
|
post: 'main.js'
|
||||||
|
|||||||
Reference in New Issue
Block a user