Skip to content

Commit 41aed3e

Browse files
committed
v7.7.0
2 parents 6f6df43 + 6ee2b68 commit 41aed3e

13 files changed

Lines changed: 244 additions & 70 deletions
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# ==================================================================================================================== #
2+
# Authors: #
3+
# Patrick Lehmann #
4+
# #
5+
# ==================================================================================================================== #
6+
# Copyright 2020-2026 The pyTooling Authors #
7+
# #
8+
# Licensed under the Apache License, Version 2.0 (the "License"); #
9+
# you may not use this file except in compliance with the License. #
10+
# You may obtain a copy of the License at #
11+
# #
12+
# http://www.apache.org/licenses/LICENSE-2.0 #
13+
# #
14+
# Unless required by applicable law or agreed to in writing, software #
15+
# distributed under the License is distributed on an "AS IS" BASIS, #
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
17+
# See the License for the specific language governing permissions and #
18+
# limitations under the License. #
19+
# #
20+
# SPDX-License-Identifier: Apache-2.0 #
21+
# ==================================================================================================================== #
22+
name: 🗑️ Cleanup
23+
24+
on:
25+
workflow_call:
26+
inputs:
27+
ubuntu_image_version:
28+
description: 'Ubuntu image version.'
29+
required: false
30+
default: '24.04'
31+
type: string
32+
json:
33+
description: 'JSON string of artifact names'
34+
required: false
35+
default: '{}'
36+
type: string
37+
artifact-json-ids:
38+
description: 'Artifacts to be removed by JSON name.'
39+
required: false
40+
default: ''
41+
type: string
42+
json2:
43+
description: 'Second JSON string of artifact names'
44+
required: false
45+
default: '{}'
46+
type: string
47+
artifact-json-ids2:
48+
description: 'Second set of artifacts to be removed by JSON name.'
49+
required: false
50+
default: ''
51+
type: string
52+
others:
53+
description: 'Other artifacts to be removed.'
54+
required: false
55+
default: ''
56+
type: string
57+
58+
jobs:
59+
CleanUp:
60+
name: 🗑️ Artifact Cleanup
61+
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
62+
steps:
63+
- name: 🧮 Compute artifact names
64+
id: compute
65+
if: inputs.json != '' && inputs.json != '{}'
66+
shell: python
67+
run: |
68+
from json import loads, dumps
69+
from os import getenv
70+
from pathlib import Path
71+
72+
artifactNames = loads("""${{ inputs.json }}""")
73+
artifactsToDelect = [k for k in "${{ inputs.artifact-json-ids }}".split(" ") if k != ""]
74+
75+
artifacts = []
76+
for name in artifactsToDelect:
77+
if name.startswith('#'):
78+
continue
79+
match name.split(":"):
80+
case [key] if key in artifactNames:
81+
artifacts.append(artifactNames[key])
82+
case [key, postfix] if key in artifactNames:
83+
artifacts.append(f"{artifactNames[key]}{postfix}")
84+
case [prefix, key] if key in artifactNames:
85+
artifacts.append(f"{prefix}{artifactNames[key]}")
86+
case [prefix, key, postfix] if key in artifactNames:
87+
artifacts.append(f"{prefix}{artifactNames[key]}{postfix}")
88+
case _:
89+
printf(f"Name '{name}' not found in JSON dictionary.")
90+
91+
print("Artifact to delete:")
92+
for name in artifacts:
93+
print(f" {name}")
94+
95+
# Write requirements path to special file
96+
github_output = Path(getenv("GITHUB_OUTPUT"))
97+
print(f"GITHUB_OUTPUT: {github_output}")
98+
with github_output.open("a+") as f:
99+
f.write(f"artifacts={dumps(artifacts)}\n")
100+
101+
- name: 🗑️ Delete artifacts
102+
uses: geekyeggo/delete-artifact@v5
103+
if: inputs.artifact-json-ids != '' && steps.compute.outputs.artifacts != ''
104+
continue-on-error: true
105+
with:
106+
name: |
107+
${{ join(fromJSON(steps.compute.outputs.artifacts).*, '
108+
') }}
109+
110+
- name: 🧮 Compute artifact names for second JSON dictionary
111+
id: compute2
112+
if: inputs.json2 != '' && inputs.json2 != '{}'
113+
shell: python
114+
run: |
115+
from json import loads, dumps
116+
from os import getenv
117+
from pathlib import Path
118+
119+
artifactNames = loads("""${{ inputs.json2 }}""")
120+
artifactsToDelect = [k for k in "${{ inputs.artifact-json-ids2 }}".split(" ") if k != ""]
121+
122+
artifacts = []
123+
for name in artifactsToDelect:
124+
if name.startswith('#'):
125+
continue
126+
match name.split(":"):
127+
case [key] if key in artifactNames:
128+
artifacts.append(artifactNames[key])
129+
case [key, postfix] if key in artifactNames:
130+
artifacts.append(f"{artifactNames[key]}{postfix}")
131+
case [prefix, key] if key in artifactNames:
132+
artifacts.append(f"{prefix}{artifactNames[key]}")
133+
case [prefix, key, postfix] if key in artifactNames:
134+
artifacts.append(f"{prefix}{artifactNames[key]}{postfix}")
135+
case _:
136+
printf(f"Name '{name}' not found in JSON dictionary.")
137+
138+
print("Artifact to delete:")
139+
for name in artifacts:
140+
print(f" {name}")
141+
142+
# Write requirements path to special file
143+
github_output = Path(getenv("GITHUB_OUTPUT"))
144+
print(f"GITHUB_OUTPUT: {github_output}")
145+
with github_output.open("a+") as f:
146+
f.write(f"artifacts={dumps(artifacts)}\n")
147+
148+
- name: 🗑️ Delete artifacts
149+
uses: geekyeggo/delete-artifact@v5
150+
if: inputs.artifact-json-ids2 != '' && steps.compute2.outputs.artifacts != ''
151+
continue-on-error: true
152+
with:
153+
name: |
154+
${{ join(fromJSON(steps.compute.outputs.artifacts).*, '
155+
') }}
156+
157+
- name: 🗑️ Delete other Artifacts
158+
uses: geekyeggo/delete-artifact@v5
159+
if: ${{ inputs.others != '' }}
160+
with:
161+
name: ${{ inputs.others }}

.github/workflows/CompletePipeline.yml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ on:
118118
required: false
119119
default: 'false'
120120
type: string
121-
cleanup:
122-
description: 'Cleanup artifacts afterwards.'
123-
required: false
124-
default: 'true'
125-
type: string
126121
documentation_steps:
127122
description: 'Create documentation.'
128123
required: false
@@ -133,6 +128,16 @@ on:
133128
required: false
134129
default: 'pytooling/miktex:sphinx'
135130
type: string
131+
auto_tag:
132+
description: 'Auto tag if a branch was merged to the release branch and an associated pull-request with matching version name was found.'
133+
required: false
134+
default: 'true'
135+
type: string
136+
cleanup:
137+
description: 'Cleanup artifacts afterwards.'
138+
required: false
139+
default: 'true'
140+
type: string
136141
secrets:
137142
PYPI_TOKEN:
138143
description: "Token for pushing releases to PyPI."
@@ -384,15 +389,17 @@ jobs:
384389
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
385390

386391
IntermediateCleanUp:
387-
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@main
392+
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@main
388393
needs:
389394
- UnitTestingParams
390395
- PublishCoverageResults
391396
- PublishTestResults
392397
if: ( success() || failure() ) && inputs.cleanup == 'true'
393398
with:
394-
sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-
395-
xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-
399+
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
400+
artifact-json-ids: >-
401+
unittesting_xml:-*
402+
codecoverage_sqlite:-*
396403
397404
PDFDocumentation:
398405
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@main
@@ -435,7 +442,7 @@ jobs:
435442
actions: write # required for trigger workflow
436443
with:
437444
version: ${{ needs.Prepare.outputs.version }}
438-
auto_tag: ${{ needs.Prepare.outputs.is_release_commit }}
445+
auto_tag: ${{ needs.Prepare.outputs.is_release_commit == 'true' && inputs.auto_tag == 'true' }}
439446
secrets: inherit
440447

441448
ReleasePage:
@@ -472,7 +479,7 @@ jobs:
472479
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
473480

474481
ArtifactCleanUp:
475-
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
482+
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@main
476483
needs:
477484
- UnitTestingParams
478485
- UnitTesting
@@ -487,20 +494,21 @@ jobs:
487494
- IntermediateCleanUp
488495
if: inputs.cleanup == 'true'
489496
with:
490-
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
491-
remaining: |
492-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-*
493-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-*
494-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-*
495-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-*
496-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
497-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
498-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
499-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
500-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
501-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
502-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
503-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
504-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
505-
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}-*
506-
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
497+
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
498+
artifact-json-ids: >-
499+
package_all
500+
unittesting_html:-*
501+
codecoverage_xml:-*
502+
codecoverage_json:-*
503+
codecoverage_html:-*
504+
unittesting_xml
505+
unittesting_html
506+
codecoverage_sqlite
507+
codecoverage_xml
508+
codecoverage_json
509+
codecoverage_html
510+
statictyping_html
511+
#apptesting_xml:-*
512+
documentation_html
513+
documentation_latex
514+
#documentation_pdf

.github/workflows/_Checking_ArtifactCleanup.yml renamed to .github/workflows/_Checking_CleanupArtifacts.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Verification Pipeline for ArtifactCleanup
22

33
on:
4-
push:
4+
# push:
55
workflow_dispatch:
66

77
jobs:
@@ -50,12 +50,13 @@ jobs:
5050
retention-days: 1
5151

5252
ArtifactCleanUp:
53-
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
53+
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@main
5454
needs:
5555
- Params
5656
- Testing
5757
- Package
5858
with:
59-
package: ${{ fromJson(needs.Params.outputs.artifact_names).package_all }}
60-
remaining: |
61-
${{ fromJson(needs.Params.outputs.artifact_names).unittesting_xml }}-*
59+
json: ${{ needs.Params.outputs.artifact_names }}
60+
artifact-json-ids: >-
61+
unittesting_xml:-*
62+
package_all

.github/workflows/_Checking_JobTemplates.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,16 @@ jobs:
187187
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
188188

189189
IntermediateCleanUp:
190-
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@main
190+
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@main
191191
needs:
192192
- UnitTestingParams
193193
- PublishCoverageResults
194194
- PublishTestResults
195195
with:
196-
sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-
197-
xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-
196+
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
197+
artifact-json-ids: >-
198+
codecoverage_sqlite:-*
199+
unittesting_xml:-*
198200
199201
PDFDocumentation:
200202
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@main
@@ -269,7 +271,7 @@ jobs:
269271
secrets: inherit
270272

271273
ArtifactCleanUp:
272-
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@main
274+
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@main
273275
needs:
274276
- UnitTestingParams
275277
- PlatformTestingParams
@@ -284,24 +286,27 @@ jobs:
284286
- Install
285287
- IntermediateCleanUp
286288
with:
287-
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
288-
remaining: |
289-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-*
290-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-*
291-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-*
292-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-*
293-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-*
294-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
295-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
296-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
297-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
298-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
299-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
300-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
301-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
302-
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
303-
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_xml }}-*
304-
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).unittesting_html }}-*
305-
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_xml }}-*
306-
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_json }}-*
307-
${{ fromJson(needs.PlatformTestingParams.outputs.artifact_names).codecoverage_html }}-*
289+
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
290+
artifact-json-ids: >-
291+
package_all
292+
unittesting_xml:-*
293+
unittesting_html:-*
294+
codecoverage_xml:-*
295+
codecoverage_json:-*
296+
codecoverage_html:-*
297+
unittesting_xml
298+
unittesting_html
299+
codecoverage_sqlite
300+
codecoverage_xml
301+
codecoverage_json
302+
codecoverage_html
303+
statictyping_html
304+
documentation_html
305+
documentation_latex
306+
json2: ${{ needs.PlatformTestingParams.outputs.artifact_names }}
307+
artifact-json-ids2: >-
308+
unittesting_xml:-*
309+
unittesting_html:-*
310+
codecoverage_xml:-*
311+
codecoverage_json:-*
312+
codecoverage_html:-*

.github/workflows/_Checking_NamespacePackage_Pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
codecov: 'true'
1717
codacy: 'true'
1818
dorny: 'true'
19-
cleanup: 'false'
2019
documentation_steps: 'html latex'
20+
auto_tag: 'false'
2121
secrets:
2222
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
2323
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/_Checking_Nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Verification of Nightly Releases
22

33
on:
4-
push:
4+
# push:
55
workflow_dispatch:
66

77
jobs:

0 commit comments

Comments
 (0)