@@ -15,32 +15,32 @@ jobs:
1515 steps :
1616 - uses : actions/checkout@v2
1717 - uses : actions/setup-python@v2
18- - uses : pre-commit/action@v2.0.0
18+ - uses : pre-commit/action@v2.0.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 :
31- - 3.10.0-rc.1
32- - 3.9
33- - 3.8
34- - 3.7
35- - 3.6
36- - 3.5
37- - pypy-3.6-v7.3.7
27+ - " 3.10"
28+ - " 3.9"
29+ - " 3.8"
30+ - " 3.7"
31+ - " 3.6"
32+ - " 3.5"
33+ - pypy-3.6-v7.3.3
3834 - pypy-3.7-v7.3.7
3935 - pypy-3.8-v7.3.7
40- - 2.7
36+ - " 2.7"
4137 - pypy-2.7
38+ os :
39+ - ubuntu-20.04
40+ - macos-10.15
41+ - windows-2022
4242 include :
43- - { os: macos-latest , py: brew@py3 }
43+ - { os: macos-10.15 , py: brew@py3 }
4444 steps :
4545 - name : Install OS dependencies
4646 run : |
@@ -61,14 +61,18 @@ jobs:
6161 - name : Setup python for tox
6262 uses : actions/setup-python@v2
6363 with :
64- python-version : 3.9
64+ python-version : " 3.10 "
6565 - name : Install tox
6666 run : python -m pip install tox
6767 - uses : actions/checkout@v2
6868 with :
6969 fetch-depth : 0
7070 - name : Use local virtualenv for tox
7171 run : python -m pip install .
72+ - name : Install Python 2 for cross test
73+ uses : actions/setup-python@v2
74+ with :
75+ python-version : " 2.7"
7276 - name : Setup python for test ${{ matrix.py }}
7377 if : " !( startsWith(matrix.py,'brew@py') || endsWith(matrix.py, '-dev') )"
7478 uses : actions/setup-python@v2
7882 if : startsWith(matrix.py,'brew@py')
7983 run : |
8084 import subprocess; import codecs; import os
81- subprocess.check_call(["bash", "-c", f "brew upgrade python@3 || brew install python@3"])
85+ subprocess.check_call(["bash", "-c", "brew upgrade python@3 || brew install python@3"])
8286 with codecs.open(os.environ["GITHUB_PATH"], "a", "utf-8") as file_handler:
8387 file_handler.write("/usr/local/opt/python@3")
8488 shell : python
@@ -101,14 +105,45 @@ jobs:
101105 CI_RUN : " yes"
102106 DIFF_AGAINST : HEAD
103107 - name : Rename coverage report file
104- run : |
105- import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml')
108+ run : import os; import sys; os.rename(".tox/.coverage.{}".format(os.environ['TOXENV']), ".tox/.coverage.{}-{}".format(os.environ['TOXENV'], sys.platform))
106109 shell : python
107- - uses : codecov/codecov-action@v1
110+ - name : Upload coverage data
111+ uses : actions/upload-artifact@v2
108112 with :
109- file : ./.tox/coverage.xml
110- flags : tests
111- name : ${{ matrix.py }} - ${{ matrix.os }}
113+ name : coverage-data
114+ path : " .tox/.coverage.*"
115+
116+ coverage :
117+ name : Combine coverage
118+ runs-on : ubuntu-latest
119+ needs : test
120+ steps :
121+ - uses : actions/checkout@v2
122+ with :
123+ fetch-depth : 0
124+ - uses : actions/setup-python@v2
125+ with :
126+ python-version : " 3.10"
127+ - name : Install tox
128+ run : python -m pip install tox
129+ - name : Setup coverage tool
130+ run : tox -e coverage --notest
131+ - name : Install package builder
132+ run : python -m pip install build
133+ - name : Build package
134+ run : pyproject-build --wheel .
135+ - name : Download coverage data
136+ uses : actions/download-artifact@v2
137+ with :
138+ name : coverage-data
139+ path : .tox
140+ - name : Combine and report coverage
141+ run : tox -e coverage
142+ - name : Upload HTML report
143+ uses : actions/upload-artifact@v2
144+ with :
145+ name : html-report
146+ path : .tox/htmlcov
112147
113148 check :
114149 name : ${{ matrix.tox_env }} - ${{ matrix.os }}
@@ -117,25 +152,25 @@ jobs:
117152 fail-fast : false
118153 matrix :
119154 os :
120- - ubuntu-latest
121- - windows-latest
155+ - ubuntu-20.04
156+ - windows-2022
122157 tox_env :
123158 - dev
124159 - docs
125160 - readme
126161 - upgrade
127162 - zipapp
128163 exclude :
129- - { os: windows-latest , tox_env: readme }
130- - { os: windows-latest , tox_env: docs }
164+ - { os: windows-2022 , tox_env: readme }
165+ - { os: windows-2022 , tox_env: docs }
131166 steps :
132167 - uses : actions/checkout@v2
133168 with :
134169 fetch-depth : 0
135- - name : Setup Python 3.9
170+ - name : Setup Python "3.10"
136171 uses : actions/setup-python@v2
137172 with :
138- python-version : 3.9
173+ python-version : " 3.10 "
139174 - name : Install tox
140175 run : python -m pip install tox
141176 - name : Run check for ${{ matrix.tox_env }}
@@ -145,13 +180,13 @@ jobs:
145180
146181 publish :
147182 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
148- needs : [check, test , lint]
149- runs-on : ubuntu-latest
183+ needs : [check, coverage , lint]
184+ runs-on : ubuntu-20.04
150185 steps :
151186 - name : Setup python to build package
152187 uses : actions/setup-python@v2
153188 with :
154- python-version : 3.9
189+ python-version : " 3.10 "
155190 - name : Install https://pypi.org/project/build
156191 run : python -m pip install build
157192 - uses : actions/checkout@v2
0 commit comments