@@ -10,48 +10,49 @@ concurrency:
1010 cancel-in-progress : true
1111
1212jobs :
13- pre-commit :
14- runs-on : ubuntu-latest
15- steps :
16- - uses : actions/checkout@v2
17- - uses : actions/setup-python@v2
18- -
uses :
pre-commit/[email protected] 19-
2013 test :
2114 name : test ${{ matrix.py }} - ${{ matrix.os }}
22- runs-on : ${{ matrix.os }}-latest
15+ runs-on : ${{ matrix.os }}
2316 strategy :
2417 fail-fast : false
2518 matrix :
26- os :
27- - Ubuntu
28- - Windows
29- - MacOs
3019 py :
31- - 3.10.0-beta.2
32- - 3.9
33- - 3.8
34- - 3.7
35- - 3.6
36- - pypy3
20+ - " 3.10"
21+ - " pypy-3.7-v7.3.7" # ahead to start it earlier because takes longer
22+ - " 3.9"
23+ - " 3.8"
24+ - " 3.7"
25+ os :
26+ - ubuntu-20.04
27+ - windows-2022
28+ - macos-10.15
29+
3730 steps :
3831 - name : Setup python for tox
3932 uses : actions/setup-python@v2
4033 with :
41- python-version : 3.9
34+ python-version : " 3.10 "
4235 - name : Install tox
4336 run : python -m pip install tox
4437 - uses : actions/checkout@v2
38+ with :
39+ fetch-depth : 0
4540 - name : Setup python for test ${{ matrix.py }}
4641 uses : actions/setup-python@v2
4742 with :
4843 python-version : ${{ matrix.py }}
4944 - name : Pick environment to run
5045 run : |
51- import subprocess; import json; import os
52- major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
53- with open(os.environ["GITHUB_ENV"], "a") as file_handler:
54- file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}') + "\n")
46+ import codecs
47+ import os
48+ import platform
49+ import sys
50+ cpy = platform.python_implementation() == "CPython"
51+ base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2])
52+ env = "TOXENV={}\n".format(base)
53+ print("Picked:\n{}for{}".format(env, sys.version))
54+ with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
55+ file_handler.write(env)
5556 shell : python
5657 - name : Setup test suite
5758 run : tox -vv --notest
@@ -60,49 +61,53 @@ jobs:
6061 env :
6162 PYTEST_ADDOPTS : " -vv --durations=20"
6263 CI_RUN : " yes"
64+ DIFF_AGAINST : HEAD
6365
6466 check :
65- name : check ${{ matrix.tox_env }} - ${{ matrix.os }}
66- runs-on : ${{ matrix.os }}-latest
67+ name : tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
68+ runs-on : ${{ matrix.os }}
6769 strategy :
6870 fail-fast : false
6971 matrix :
7072 os :
71- - Ubuntu
72- - Windows
73+ - ubuntu-20.04
74+ - windows-2022
7375 tox_env :
74- - type
7576 - dev
76- - pkg_desc
77+ - type
78+ - readme
7779 exclude :
78- - { os: Windows, tox_env: pkg_desc }
79-
80+ - { os: windows-latest, tox_env: readme }
8081 steps :
8182 - uses : actions/checkout@v2
82- - name : Setup python
83+ with :
84+ fetch-depth : 0
85+ - name : Setup Python "3.10"
8386 uses : actions/setup-python@v2
8487 with :
85- python-version : 3.9
88+ python-version : " 3.10 "
8689 - name : Install tox
8790 run : python -m pip install tox
88- - name : Run check for ${{ matrix.tox_env }}
89- run : python -m tox -e ${{ matrix.tox_env }}
90- env :
91- UPGRADE_ADVISORY : " yes "
91+ - name : Setup test suite
92+ run : tox -vv --notest -e ${{ matrix.tox_env }}
93+ - name : Run test suite
94+ run : tox --skip-pkg-install -e ${{ matrix.tox_env }}
9295
9396 publish :
9497 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
95- needs : [check, test, pre-commit ]
96- runs-on : ubuntu-latest
98+ needs : [ check, test ]
99+ runs-on : ubuntu-20.04
97100 steps :
98101 - name : Setup python to build package
99102 uses : actions/setup-python@v2
100103 with :
101- python-version : 3.9
104+ python-version : " 3.10 "
102105 - name : Install build
103- run : python -m pip install ' build>=0.4'
106+ run : python -m pip install build
104107 - uses : actions/checkout@v2
105- - name : Build package
108+ with :
109+ fetch-depth : 0
110+ - name : Build sdist and wheel
106111 run : python -m build -s -w . -o dist
107112 - name : Publish to PyPi
108113 uses : pypa/gh-action-pypi-publish@master
0 commit comments