@@ -15,25 +15,25 @@ jobs:
1515 steps :
1616 - uses : actions/checkout@v2
1717 - uses : actions/setup-python@v2
18- -
uses :
pre-commit/[email protected] .0 18+ -
uses :
pre-commit/[email protected] .3 1919
2020 test :
2121 name : test ${{ matrix.py }} - ${{ matrix.os }}
2222 runs-on : ${{ matrix.os }}
2323 strategy :
2424 fail-fast : false
2525 matrix :
26- os :
27- - ubuntu-latest
28- - windows-latest
29- - macos-latest
3026 py :
3127 - " 3.10"
3228 - " 3.9"
3329 - " 3.8"
3430 - " 3.7"
3531 - " 3.6"
3632 - " pypy-3.7-v7.3.7"
33+ os :
34+ - ubuntu-20.04
35+ - windows-2022
36+ - macos-10.15
3737
3838 steps :
3939 - name : Setup python for tox
5151 python-version : ${{ matrix.py }}
5252 - name : Pick environment to run
5353 run : |
54- import platform ; import os; import sys ; import codecs
54+ import codecs ; import os; import platform ; import sys
5555 cpy = platform.python_implementation() == "CPython"
5656 base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
5757 env = "TOXENV={}\n".format(base)
@@ -68,14 +68,45 @@ jobs:
6868 CI_RUN : " yes"
6969 DIFF_AGAINST : HEAD
7070 - name : Rename coverage report file
71- run : |
72- import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
71+ run : import os; import sys; os.rename(f".tox/.coverage.{os.environ['TOXENV']}", f".tox/.coverage.{os.environ['TOXENV']}-{sys.platform}")
7372 shell : python
74- - uses : codecov/codecov-action@v1
73+ - name : Upload coverage data
74+ uses : actions/upload-artifact@v2
75+ with :
76+ name : coverage-data
77+ path : " .tox/.coverage.*"
78+
79+ coverage :
80+ name : Combine coverage
81+ runs-on : ubuntu-latest
82+ needs : test
83+ steps :
84+ - uses : actions/checkout@v2
85+ with :
86+ fetch-depth : 0
87+ - uses : actions/setup-python@v2
88+ with :
89+ python-version : " 3.10"
90+ - name : Install tox
91+ run : python -m pip install tox
92+ - name : Setup coverage tool
93+ run : tox -e coverage --notest
94+ - name : Install package builder
95+ run : python -m pip install build
96+ - name : Build package
97+ run : pyproject-build --wheel .
98+ - name : Download coverage data
99+ uses : actions/download-artifact@v2
100+ with :
101+ name : coverage-data
102+ path : .tox
103+ - name : Combine and report coverage
104+ run : tox -e coverage
105+ - name : Upload HTML report if check failed
106+ uses : actions/upload-artifact@v2
75107 with :
76- file : ./.tox/coverage.xml
77- flags : tests
78- name : ${{ matrix.py }} - ${{ matrix.os }}
108+ name : html-report
109+ path : htmlcov
79110
80111 check :
81112 name : ${{ matrix.tox_env }} - ${{ matrix.os }}
@@ -110,14 +141,14 @@ jobs:
110141
111142 publish :
112143 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
113- needs : [check, test , lint]
144+ needs : [ check, coverage , lint ]
114145 runs-on : ubuntu-latest
115146 steps :
116147 - name : Setup python to build package
117148 uses : actions/setup-python@v2
118149 with :
119150 python-version : " 3.10"
120- - name : Install https://pypi.org/project/ build
151+ - name : Install build
121152 run : python -m pip install build
122153 - uses : actions/checkout@v2
123154 with :
0 commit comments