@@ -16,6 +16,10 @@ permissions:
16
16
contents : read # to fetch code (actions/checkout)
17
17
18
18
env :
19
+ FORCE_COLOR : " 1" # Make tools pretty.
20
+ TOX_TESTENV_PASSENV : FORCE_COLOR
21
+ PIP_DISABLE_PIP_VERSION_CHECK : " 1"
22
+ PIP_NO_PYTHON_VERSION_WARNING : " 1"
19
23
PYTHON_LATEST : " 3.11"
20
24
21
25
32
36
python-version : ${{env.PYTHON_LATEST}}
33
37
-
uses :
pre-commit/[email protected]
34
38
35
- test :
39
+ tests :
36
40
runs-on : ubuntu-latest
37
41
needs : lint
38
42
strategy :
@@ -41,17 +45,56 @@ jobs:
41
45
42
46
steps :
43
47
- uses : actions/checkout@v3
44
- - name : Setup Python ${{ matrix.python }}
48
+ - name : 🐍 Setup Python ${{ matrix.python }}
45
49
uses : actions/setup-python@v4
46
50
with :
47
51
python-version : ${{ matrix.python }}
48
- - name : Install dependencies
52
+ - name : 📦 Install dependencies
49
53
run : |
50
- python -Im pip install --upgrade pip
51
54
python -Im pip install tox tox-gh-actions wheel
52
55
53
56
- name : 🏗️ Build wheel
54
57
run : python setup.py bdist_wheel
55
58
56
59
- name : 🧪 Run tox targets for Python ${{ matrix.python-version }}
57
60
run : tox --installpkg ./dist/*.whl
61
+
62
+ - name : ⬆️ Upload coverage data
63
+ uses : actions/upload-artifact@v3
64
+ with :
65
+ name : coverage-data
66
+ path : .coverage.*
67
+ if-no-files-found : ignore
68
+ retention-days : 1
69
+
70
+ coverage :
71
+ runs-on : ubuntu-latest
72
+ needs : tests
73
+ steps :
74
+ - uses : actions/checkout@v3
75
+ with :
76
+ fetch-depth : 0
77
+ - uses : actions/setup-python@v4
78
+ with :
79
+ # Use latest Python, so it understands all syntax.
80
+ python-version : ${{env.PYTHON_LATEST}}
81
+
82
+ - run : python -Im pip install --upgrade "coverage[toml]>=7.2,<8.0"
83
+
84
+ - name : ⬇️ Download coverage data
85
+ uses : actions/download-artifact@v3
86
+ with :
87
+ name : coverage-data
88
+
89
+ - name : + Combine coverage
90
+ run : |
91
+ python -Im coverage combine
92
+ python -Im coverage html --skip-covered --skip-empty
93
+ python -Im coverage report
94
+ echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
95
+ python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
96
+ - name : 📈 Upload HTML report if check failed.
97
+ uses : actions/upload-artifact@v3
98
+ with :
99
+ name : html-report
100
+ path : htmlcov
0 commit comments