@@ -7,6 +7,7 @@ defaults:
77 shell : bash
88
99jobs :
10+
1011 UnitTesting :
1112 name : ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
1213 runs-on : ubuntu-latest
@@ -15,10 +16,11 @@ jobs:
1516 fail-fast : false
1617 matrix :
1718 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
2224
2325 env :
2426 PYTHON : ${{ matrix.python }}
@@ -41,14 +43,14 @@ jobs:
4143
4244 - name : ☑ Run unit tests
4345 run : |
44- python -m pytest -rA tests/unit
46+ python -m pytest -rA tests/unit --color=yes
4547
4648 Coverage :
47- name : 📈 Collect Coverage Data using Python 3.9
49+ name : 📈 Collect Coverage Data using Python 3.10
4850 runs-on : ubuntu-latest
4951
5052 env :
51- PYTHON : 3.9
53+ PYTHON : " 3.10 "
5254 ARTIFACT : pyEDAA-ProjectModel-coverage-html
5355 outputs :
5456 python : ${{ env.PYTHON }}
7173 - name : Collect coverage
7274 continue-on-error : true
7375 run : |
74- 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
7577
7678 - name : Convert to cobertura format
7779 run : |
@@ -106,11 +108,11 @@ jobs:
106108 retention-days : 1
107109
108110 StaticTypeCheck :
109- name : 📈 Check Static Typing using Python 3.9
111+ name : 👀 Check Static Typing using Python 3.10
110112 runs-on : ubuntu-latest
111113
112114 env :
113- PYTHON : 3.9
115+ PYTHON : " 3.10 "
114116 ARTIFACT : pyEDAA-ProjectModel-typing-html
115117 outputs :
116118 python : ${{ env.PYTHON }}
@@ -282,12 +284,61 @@ jobs:
282284 run : |
283285 twine upload dist/*
284286
287+ VerifyDocs :
288+ name : 👍 Verify example snippets using Python 3.10
289+ runs-on : ubuntu-latest
290+
291+ env :
292+ PYTHON : " 3.10"
293+ outputs :
294+ python : ${{ env.PYTHON }}
295+
296+ steps :
297+ - name : ⏬ Checkout repository
298+ uses : actions/checkout@v2
299+
300+ - name : 🐍 Setup Python
301+ uses : actions/setup-python@v2
302+ with :
303+ python-version : ${{ env.PYTHON }}
304+
305+ - name : 🐍 Install dependencies
306+ run : |
307+ pip3 install .
308+
309+ - name : ✂ Extract code snippet from README
310+ shell : python
311+ run : |
312+ from pathlib import Path
313+ import re
314+
315+ ROOT = Path('.')
316+
317+ with (ROOT / 'README.md').open('r') as rptr:
318+ content = rptr.read()
319+
320+ m = re.search(r"```py(thon)?(?P<code>.*?)```", content, re.MULTILINE|re.DOTALL)
321+
322+ if m is None:
323+ raise Exception("Regular expression did not find the example in the README!")
324+
325+ with (ROOT / 'tests/docs/example.py').open('w') as wptr:
326+ wptr.write(m["code"])
327+
328+ - name : Print example.py
329+ run : cat tests/docs/example.py
330+
331+ - name : ☑ Run example snippet
332+ working-directory : tests/docs
333+ run : |
334+ python3 example.py
335+
285336 BuildTheDocs :
286- name : 📓 Run BuildTheDocs and publish to GH-Pages
337+ name : 📓 Run BuildTheDocs
287338 runs-on : ubuntu-latest
339+ needs :
340+ - VerifyDocs
288341
289- # needs:
290- # - VerifyDocs
291342 env :
292343 ARTIFACT : pyEDAA-ProjectModel-documentation
293344 outputs :
@@ -304,10 +355,10 @@ jobs:
304355 RUN apk add -U --no-cache graphviz
305356 EOF
306357
307- - name : 🛳️ Build documentation using container edaa/doc and publish to GitHub Pages
358+ - name : 🛳️ Build documentation using container edaa/doc
308359 uses : buildthedocs/btd@v0
309360 with :
310- token : ${{ github.token }}
361+ skip-deploy : true
311362
312363 - name : 📤 Upload 'documentation' artifacts
313364 uses : actions/upload-artifact@master
@@ -316,27 +367,76 @@ jobs:
316367 path : doc/_build/html
317368 retention-days : 7
318369
319- ArtifactCleanUp :
320- name : 🗑️ Artifact Cleanup
370+ PublishToGitHubPages :
371+ name : 📚 Publish to GH-Pages
321372 runs-on : ubuntu-latest
322-
323373 needs :
374+ - BuildTheDocs
324375 - Coverage
325376 - StaticTypeCheck
377+
378+ env :
379+ DOC : ${{ needs.BuildTheDocs.outputs.artifact }}
380+ COVERAGE : ${{ needs.Coverage.outputs.artifact }}
381+ TYPING : ${{ needs.StaticTypeCheck.outputs.artifact }}
382+ outputs :
383+ artifact : ${{ env.ARTIFACT }}
384+
385+ steps :
386+ - name : Checkout repository
387+ uses : actions/checkout@v2
388+
389+ - name : 📥 Download artifacts '${{ env.DOC }}' from 'StaticTypeCheck' job
390+ uses : actions/download-artifact@v2
391+ with :
392+ name : ${{ env.DOC }}
393+ path : public
394+
395+ - name : 📥 Download artifacts '${{ env.COVERAGE }}' from 'Coverage' job
396+ uses : actions/download-artifact@v2
397+ with :
398+ name : ${{ env.COVERAGE }}
399+ path : public/coverage
400+
401+ - name : 📥 Download artifacts '${{ env.TYPING }}' from 'StaticTypeCheck' job
402+ uses : actions/download-artifact@v2
403+ with :
404+ name : ${{ env.TYPING }}
405+ path : public/typing
406+
407+ - name : ' 📓 Publish site to GitHub Pages'
408+ if : github.event_name != 'pull_request'
409+ run : |
410+ cd public
411+ touch .nojekyll
412+ git init
413+ cp ../.git/config ./.git/config
414+ git add .
415+ git config --local user.email "BuildTheDocs@GitHubActions"
416+ git config --local user.name "GitHub Actions"
417+ git commit -a -m "update ${{ github.sha }}"
418+ git push -u origin +HEAD:gh-pages
419+
420+ ArtifactCleanUp :
421+ name : 🗑️ Artifact Cleanup
422+ runs-on : ubuntu-latest
423+ needs :
326424 - Package
327425 - PublishOnPyPI
426+ - PublishToGitHubPages
328427
329428 env :
330429 COVERAGE : ${{ needs.Coverage.outputs.artifact }}
331430 TYPING : ${{ needs.StaticTypeCheck.outputs.artifact }}
332431 PACKAGE : ${{ needs.Package.outputs.artifact }}
432+ DOC : ${{ needs.BuildTheDocs.outputs.artifact }}
333433
334434 steps :
335435 - name : 🗑️ Delete all Artifacts
336436 uses : geekyeggo/delete-artifact@v1
337437 with :
338438 name : |
439+ ${{ env.COVERAGE }}
440+ ${{ env.TYPING }}
339441 ${{ env.PACKAGE }}
340-
341- # ${{ env.COVERAGE }}
342- # ${{ env.TYPING }}
442+ ${{ env.DOC }}
0 commit comments