Repository navigation
370 lines (339 loc) · 15.1 KB
/
Copy path_Checking_JobTemplates.yml
File metadata and controls
370 lines (339 loc) · 15.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
name: Verification of Job Templates
run-name: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
on:
push:
# 'update/rN' carries a version branch's rewritten references; only 'Pipeline.yml' runs there.
branches-ignore:
- 'update/**'
tags:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }} # tag pushes can publish a release, so never cancel those
jobs:
Prepare:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
PagesConditions:
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
with:
publish_pages_on: |
# a comment line and an empty line
default-branch
main-branch
development-branch
release-branch
release-tag
nightly-tag
branch=.+
tag=.+
CheckPagesConditions:
name: 🔍 Check 'publish_pages' of PrepareJob
runs-on: ubuntu-26.04
needs:
- PagesConditions
steps:
- name: Check that 'branch=.+' and 'tag=.+' match every pipeline
env:
PUBLISH_PAGES: ${{ needs.PagesConditions.outputs.publish_pages }}
run: |
printf -- 'publish_pages: %s\n' "${PUBLISH_PAGES}"
if [[ "${PUBLISH_PAGES}" != "true" ]]; then
printf -- "::error title=PagesConditions::Expected 'true', got '%s'.\n" "${PUBLISH_PAGES}"
exit 1
fi
ConfigParams:
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev
UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
package_name: 'myPackage'
python_version_list: '3.11 3.12 3.13 3.14 3.15 pypy-3.11 pypy-3.12'
disable_list: 'windows-arm:pypy-3.11 windows-arm:pypy-3.12'
documentation_steps: 'all'
PlatformTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
package_name: 'myPackage'
name: 'Platform'
python_version_list: ''
system_list: 'ubuntu ubuntu-arm windows windows-arm macos clang64 ucrt64'
documentation_steps: 'none'
AppTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
package_name: 'myPackage'
python_version_list: '' # just the default Python version, but on all systems
InstallParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
with:
package_name: 'myPackage'
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
python_version_list: ''
documentation_steps: ''
UnitTesting:
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
needs:
- ConfigParams
- UnitTestingParams
with:
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
unittest_report_xml: ${{ needs.ConfigParams.outputs.unittest_report_xml }}
coverage_report_xml: ${{ needs.ConfigParams.outputs.coverage_report_xml }}
coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
coverage_report_html: ${{ needs.ConfigParams.outputs.coverage_report_html }}
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@dev
needs:
- ConfigParams
- PlatformTestingParams
with:
jobs: ${{ needs.PlatformTestingParams.outputs.python_jobs }}
# tests_directory: ""
unittest_directory: platform
unittest_report_xml: ${{ needs.ConfigParams.outputs.unittest_report_xml }}
coverage_report_xml: ${{ needs.ConfigParams.outputs.coverage_report_xml }}
coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
coverage_report_html: ${{ needs.ConfigParams.outputs.coverage_report_html }}
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@dev
needs:
- ConfigParams
- UnitTestingParams
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
html_report: ${{ needs.ConfigParams.outputs.typing_report_html }}
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
CodeQuality:
uses: pyTooling/Actions/.github/workflows/CheckCodeQuality.yml@dev
needs:
- UnitTestingParams
- PublishTestResults # artificial dependency to delay start when pipeline has free job resources
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
bandit: 'true'
pylint: 'true'
artifact: 'CodeQuality'
DocCoverage:
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev
needs:
- ConfigParams
- UnitTestingParams
- StaticTypeCheck # artificial dependency to delay start when pipeline has free job resources
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
directory : ${{ needs.ConfigParams.outputs.package_directory }}
# fail_below: 70
Package:
uses: pyTooling/Actions/.github/workflows/Package.yml@dev
needs:
- UnitTestingParams
# - UnitTesting
# - 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@dev
needs:
- UnitTestingParams
- InstallParams
- Package
with:
jobs: ${{ needs.InstallParams.outputs.python_jobs }}
wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
package_name: ${{ needs.UnitTestingParams.outputs.package_fullname }}
ExampleReport:
name: 📄 Example report for the application tests
runs-on: ubuntu-26.04
steps:
- name: 📄 Write an example report
run: |
mkdir -p report
printf -- '%s\n' 'Report of an example job.' > report/Example.txt
- name: 📤 Upload the example report as artifact
uses: pyTooling/upload-artifact@v7
with:
name: Example-Report
path: report/Example.txt
AppTesting:
uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@dev
needs:
- ConfigParams
- AppTestingParams
- UnitTestingParams
- Package
- ExampleReport
with:
jobs: ${{ needs.AppTestingParams.outputs.python_jobs }}
wheel: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
artifacts_pattern: 'Example-*'
apptest_report_xml: ${{ needs.ConfigParams.outputs.unittest_report_xml }}
apptest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }}
PublishCoverageResults:
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev
needs:
- ConfigParams
- UnitTestingParams
- UnitTesting
- PlatformTesting
with:
coverage_report_xml: ${{ needs.ConfigParams.outputs.coverage_report_xml }}
coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
coverage_report_html: ${{ needs.ConfigParams.outputs.coverage_report_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 }}
codecov: true
codacy: true
secrets: inherit
PublishTestResults:
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev
needs:
- ConfigParams
- UnitTestingParams
- UnitTesting
- PlatformTesting
- AppTesting
if: ${{ !cancelled() }} # not 'success() || failure()', because that's false if a dependency was skipped
with:
additional_merge_args: '-d "--pytest=rewrite-dunder-init;reduce-depth:pytest.tests.unit;reduce-depth:pytest.tests.platform;reduce-depth:pytest.tests.app"'
testsuite-summary-name: ${{ needs.UnitTestingParams.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@dev
# needs:
# - UnitTestingParams
# with:
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
Documentation:
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev
needs:
- ConfigParams
- UnitTestingParams
- PublishTestResults
- PublishCoverageResults
# - VerifyDocs
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
unittest_xml: ${{ needs.ConfigParams.outputs.unittest_report_xml }}
coverage_report_json: ${{ needs.ConfigParams.outputs.coverage_report_json }}
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/CleanupArtifacts.yml@dev
needs:
- UnitTestingParams
- PublishCoverageResults
- PublishTestResults
with:
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
artifact-json-ids: >-
codecoverage_sqlite:-*
unittesting_xml:-*
PDFDocumentation:
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev
needs:
- UnitTestingParams
- Documentation
with:
document: 'myPackage'
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
PublishToGitHubPages:
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev
needs:
- UnitTestingParams
- Documentation
- PDFDocumentation
- PublishCoverageResults
- StaticTypeCheck
with:
doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
ReleaseCheck:
uses: pyTooling/Actions/.github/workflows/CheckReleaseVersion.yml@dev
with:
version: 'v99.0.0'
package_version: '99.0.0'
check_pypi_duplicate: 'true'
pypi_package: 'pyTooling'
PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev
needs:
- UnitTestingParams
- Package
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
dry_run: 'true' # 'myPackage' is a fixture - never publish it
publish_sdist: 'false' # as pyTooling's own pipeline does
cleanup: 'false' # 'ArtifactCleanUp' deletes it
secrets: inherit
ArtifactCleanUp:
uses: pyTooling/Actions/.github/workflows/CleanupArtifacts.yml@dev
needs:
- Prepare
- UnitTestingParams
- PlatformTestingParams
- UnitTesting
- StaticTypeCheck
- PlatformTesting
- Documentation
- PDFDocumentation
- PublishTestResults
- PublishCoverageResults
- PublishToGitHubPages
- Install
- IntermediateCleanUp
if: ${{ !cancelled() }} # match 'CompletePipeline.yml': still clean up when an unrelated job failed
with:
json: ${{ needs.UnitTestingParams.outputs.artifact_names }}
artifact-json-ids: >-
unittesting_xml:-*
unittesting_html:-*
codecoverage_xml:-*
codecoverage_json:-*
codecoverage_html:-*
unittesting_xml
unittesting_html
codecoverage_sqlite
codecoverage_xml
codecoverage_json
codecoverage_html
statictyping_html
#apptesting_xml:-*
documentation_html
documentation_latex
# The package artifact is kept on a release-tag run: 'PublishOnPyPI' consumes it and deletes it itself.
json2: ${{ needs.UnitTestingParams.outputs.artifact_names }}
condition2: ${{ needs.Prepare.outputs.is_release_tag != 'true' }}
artifact-json-ids2: >-
package_all
# The platform artifacts are unconditional, and both JSON slots are taken, so they are listed literally.
others: |
${{ 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 }}-*