@@ -7,6 +7,7 @@ defaults:
7
7
shell : bash
8
8
9
9
jobs :
10
+
10
11
UnitTesting :
11
12
name : ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
12
13
runs-on : ubuntu-latest
@@ -15,10 +16,11 @@ jobs:
15
16
fail-fast : false
16
17
matrix :
17
18
include :
18
- - {python: 3.6, icon: 🔴}
19
- - {python: 3.7, icon: 🟠}
20
- - {python: 3.8, icon: 🟡}
21
- - {python: 3.9, icon: 🟢}
19
+ - {python: "3.6", icon: 🔴} # until 23.12.2021
20
+ - {python: "3.7", icon: 🟠} # until 27.06.2023
21
+ - {python: "3.8", icon: 🟡} # until Oct. 2024
22
+ - {python: "3.9", icon: 🟢} # until Oct. 2025
23
+ - {python: "3.10", icon: 🟢} # until Oct. 2026
22
24
23
25
env :
24
26
PYTHON : ${{ matrix.python }}
@@ -41,16 +43,18 @@ jobs:
41
43
42
44
- name : ☑ Run unit tests
43
45
run : |
44
- python -m pytest -rA tests/unit
46
+ python -m pytest -rA tests/unit --color=yes
45
47
46
48
Coverage :
47
- name : 📈 Collect Coverage Data using Python 3.9
49
+ name : 📈 Collect Coverage Data using Python 3.10
48
50
runs-on : ubuntu-latest
49
51
50
52
env :
51
- PYTHON : 3.9
53
+ PYTHON : " 3.10"
54
+ ARTIFACT : pyTooling.TerminalUI-coverage-html
52
55
outputs :
53
56
python : ${{ env.PYTHON }}
57
+ artifact : ${{ env.ARTIFACT }}
54
58
55
59
steps :
56
60
- name : ⏬ Checkout repository
@@ -69,12 +73,17 @@ jobs:
69
73
- name : Collect coverage
70
74
continue-on-error : true
71
75
run : |
72
- python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit
76
+ python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit --color=yes
73
77
74
78
- name : Convert to cobertura format
75
79
run : |
76
80
coverage xml
77
81
82
+ - name : Convert to HTML format
83
+ run : |
84
+ coverage html
85
+ rm htmlcov/.gitignore
86
+
78
87
- name : 📊 Publish coverage at CodeCov
79
88
continue-on-error : true
80
89
uses : codecov/codecov-action@v1
90
99
project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
91
100
coverage-reports : ./coverage.xml
92
101
102
+ - name : 📤 Upload 'Coverage Report' artifact
103
+ continue-on-error : true
104
+ uses : actions/upload-artifact@v2
105
+ with :
106
+ name : ${{ env.ARTIFACT }}
107
+ path : htmlcov
108
+ if-no-files-found : error
109
+ retention-days : 1
110
+
111
+ StaticTypeCheck :
112
+ name : 👀 Check Static Typing using Python 3.10
113
+ runs-on : ubuntu-latest
114
+
115
+ env :
116
+ PYTHON : " 3.10"
117
+ ARTIFACT : pyTooling.TerminalUI-typing-html
118
+ outputs :
119
+ python : ${{ env.PYTHON }}
120
+ artifact : ${{ env.ARTIFACT }}
121
+
122
+ steps :
123
+ - name : ⏬ Checkout repository
124
+ uses : actions/checkout@v2
125
+
126
+ - name : 🐍 Setup Python ${{ env.PYTHON }}
127
+ uses : actions/setup-python@v2
128
+ with :
129
+ python-version : ${{ env.PYTHON }}
130
+
131
+ - name : 🗂 Install dependencies
132
+ run : |
133
+ python -m pip install --upgrade pip
134
+ pip install -r tests/requirements.txt
135
+
136
+ - name : Check Static Typing
137
+ continue-on-error : true
138
+ run : |
139
+ pwd
140
+ mypy --html-report htmlmypy -m pyTooling.TerminalUI
141
+
142
+ - name : 📤 Upload 'Static Typing Report' artifact
143
+ continue-on-error : true
144
+ uses : actions/upload-artifact@v2
145
+ with :
146
+ name : ${{ env.ARTIFACT }}
147
+ path : htmlmypy
148
+ if-no-files-found : error
149
+ retention-days : 1
150
+
151
+
93
152
Release :
94
153
name : 📝 Create 'Release Page' on GitHub
95
154
runs-on : ubuntu-latest
98
157
needs :
99
158
- UnitTesting
100
159
- Coverage
160
+ - StaticTypeCheck
101
161
102
162
env :
103
163
PYTHON : ${{ needs.Coverage.outputs.python }}
@@ -152,7 +212,7 @@ jobs:
152
212
153
213
env :
154
214
PYTHON : ${{ needs.Coverage.outputs.python }}
155
- ARTIFACT : pyTerminalUI -wheel
215
+ ARTIFACT : pyTooling.TerminalUI -wheel
156
216
outputs :
157
217
python : ${{ env.PYTHON }}
158
218
artifact : ${{ env.ARTIFACT }}
@@ -179,7 +239,7 @@ jobs:
179
239
run : |
180
240
python setup.py bdist_wheel
181
241
182
- - name : 📤 Upload 'pyTerminalUI ' artifact
242
+ - name : 📤 Upload 'pyTooling.TerminalUI ' artifact
183
243
uses : actions/upload-artifact@v2
184
244
with :
185
245
name : ${{ env.ARTIFACT }}
@@ -193,6 +253,7 @@ jobs:
193
253
194
254
if : startsWith(github.ref, 'refs/tags')
195
255
needs :
256
+ - Release
196
257
- Package
197
258
198
259
env :
@@ -226,20 +287,164 @@ jobs:
226
287
run : |
227
288
twine upload dist/*
228
289
290
+ - name : 🗑️ Delete packaging Artifacts
291
+ uses : geekyeggo/delete-artifact@v1
292
+ with :
293
+ name : |
294
+ ${{ env.ARTIFACT }}
295
+
296
+ # VerifyDocs:
297
+ # name: 👍 Verify example snippets using Python 3.10
298
+ # runs-on: ubuntu-latest
299
+ #
300
+ # env:
301
+ # PYTHON: "3.10"
302
+ # outputs:
303
+ # python: ${{ env.PYTHON }}
304
+ #
305
+ # steps:
306
+ # - name: ⏬ Checkout repository
307
+ # uses: actions/checkout@v2
308
+ #
309
+ # - name: 🐍 Setup Python
310
+ # uses: actions/setup-python@v2
311
+ # with:
312
+ # python-version: ${{ env.PYTHON }}
313
+ #
314
+ # - name: 🐍 Install dependencies
315
+ # run: |
316
+ # pip3 install .
317
+ #
318
+ # - name: ✂ Extract code snippet from README
319
+ # shell: python
320
+ # run: |
321
+ # from pathlib import Path
322
+ # import re
323
+ #
324
+ # ROOT = Path('.')
325
+ #
326
+ # with (ROOT / 'README.md').open('r') as rptr:
327
+ # content = rptr.read()
328
+ #
329
+ # m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
330
+ #
331
+ # if m is None:
332
+ # raise Exception("Regular expression did not find the example in the README!")
333
+ #
334
+ # with (ROOT / 'tests/docs/example.py').open('w') as wptr:
335
+ # wptr.write(m["code"])
336
+ #
337
+ # - name: Print example.py
338
+ # run: cat tests/docs/example.py
339
+ #
340
+ # - name: ☑ Run example snippet
341
+ # working-directory: tests/docs
342
+ # run: |
343
+ # python3 example.py
344
+
345
+ BuildTheDocs :
346
+ name : 📓 Run BuildTheDocs
347
+ runs-on : ubuntu-latest
348
+ # needs:
349
+ # - VerifyDocs
350
+
351
+ env :
352
+ ARTIFACT : pyTooling.TerminalUI-documentation
353
+ outputs :
354
+ artifact : ${{ env.ARTIFACT }}
355
+
356
+ steps :
357
+ - name : Checkout repository
358
+ uses : actions/checkout@v2
359
+
360
+ - name : 🚢 Build container image 'vhdl/doc'
361
+ run : |
362
+ docker build -t edaa/doc - <<-EOF
363
+ FROM btdi/sphinx:featured
364
+ RUN apk add -U --no-cache graphviz
365
+ EOF
366
+
367
+ - name : 🛳️ Build documentation using container edaa/doc
368
+ uses : buildthedocs/btd@v0
369
+ with :
370
+ skip-deploy : true
371
+
372
+ - name : 📤 Upload 'documentation' artifacts
373
+ uses : actions/upload-artifact@master
374
+ with :
375
+ name : ${{ env.ARTIFACT }}
376
+ path : doc/_build/html
377
+ retention-days : 7
378
+
379
+ PublishToGitHubPages :
380
+ name : 📚 Publish to GH-Pages
381
+ runs-on : ubuntu-latest
382
+ needs :
383
+ - BuildTheDocs
384
+ - Coverage
385
+ # - StaticTypeCheck
386
+
387
+ env :
388
+ DOC : ${{ needs.BuildTheDocs.outputs.artifact }}
389
+ COVERAGE : ${{ needs.Coverage.outputs.artifact }}
390
+ # TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
391
+ outputs :
392
+ artifact : ${{ env.ARTIFACT }}
393
+
394
+ steps :
395
+ - name : Checkout repository
396
+ uses : actions/checkout@v2
397
+
398
+ - name : 📥 Download artifacts '${{ env.DOC }}' from 'BuildTheDocs' job
399
+ uses : actions/download-artifact@v2
400
+ with :
401
+ name : ${{ env.DOC }}
402
+ path : public
403
+
404
+ - name : 📥 Download artifacts '${{ env.COVERAGE }}' from 'Coverage' job
405
+ uses : actions/download-artifact@v2
406
+ with :
407
+ name : ${{ env.COVERAGE }}
408
+ path : public/coverage
409
+
410
+ # - name: 📥 Download artifacts '${{ env.TYPING }}' from 'StaticTypeCheck' job
411
+ # uses: actions/download-artifact@v2
412
+ # with:
413
+ # name: ${{ env.TYPING }}
414
+ # path: public/typing
415
+
416
+ - name : ' 📓 Publish site to GitHub Pages'
417
+ if : github.event_name != 'pull_request'
418
+ run : |
419
+ cd public
420
+ touch .nojekyll
421
+ git init
422
+ cp ../.git/config ./.git/config
423
+ git add .
424
+ git config --local user.email "BuildTheDocs@GitHubActions"
425
+ git config --local user.name "GitHub Actions"
426
+ git commit -a -m "update ${{ github.sha }}"
427
+ git push -u origin +HEAD:gh-pages
428
+
229
429
ArtifactCleanUp :
230
430
name : 🗑️ Artifact Cleanup
231
431
runs-on : ubuntu-latest
232
-
233
432
needs :
234
- - Package
235
- - PublishOnPyPI
433
+ - Coverage
434
+ # - StaticTypeCheck
435
+ - BuildTheDocs
436
+ - PublishToGitHubPages
236
437
237
438
env :
238
- ARTIFACT : ${{ needs.Package.outputs.artifact }}
439
+ COVERAGE : ${{ needs.Coverage.outputs.artifact }}
440
+ # TYPING: ${{ needs.StaticTypeCheck.outputs.artifact }}
441
+ DOC : ${{ needs.BuildTheDocs.outputs.artifact }}
239
442
240
443
steps :
241
444
- name : 🗑️ Delete all Artifacts
242
445
uses : geekyeggo/delete-artifact@v1
243
446
with :
244
447
name : |
245
- ${{ env.ARTIFACT }}
448
+ ${{ env.COVERAGE }}
449
+ ${{ env.DOC }}
450
+ # ${{ env.TYPING }}
0 commit comments