@@ -10,47 +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-rc.2
32- - 3.9
33- - 3.8
34- - 3.7
35- - pypy-3.7-v7.3.5
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+
3630 steps :
3731 - name : Setup python for tox
3832 uses : actions/setup-python@v2
3933 with :
40- python-version : 3.10.0-rc.2
34+ python-version : " 3.10"
4135 - name : Install tox
4236 run : python -m pip install tox
4337 - uses : actions/checkout@v2
38+ with :
39+ fetch-depth : 0
4440 - name : Setup python for test ${{ matrix.py }}
4541 uses : actions/setup-python@v2
4642 with :
4743 python-version : ${{ matrix.py }}
4844 - name : Pick environment to run
4945 run : |
50- import subprocess; import json; import os
51- 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))
52- with open(os.environ["GITHUB_ENV"], "a") as file_handler:
53- file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}{minor}') + "\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)
5456 shell : python
5557 - name : Setup test suite
5658 run : tox -vv --notest
@@ -61,47 +63,50 @@ jobs:
6163 CI_RUN : " yes"
6264
6365 check :
64- name : check ${{ matrix.tox_env }} - ${{ matrix.os }}
65- runs-on : ${{ matrix.os }}-latest
66+ name : tox env ${{ matrix.tox_env }} - ${{ matrix.os }}
67+ runs-on : ${{ matrix.os }}
6668 strategy :
6769 fail-fast : false
6870 matrix :
6971 os :
70- - Ubuntu
71- - Windows
72+ - ubuntu-20.04
73+ - windows-2022
7274 tox_env :
73- - type
7475 - dev
75- - pkg_desc
76+ - type
77+ - readme
7678 exclude :
77- - { os: Windows, tox_env: pkg_desc }
78-
79+ - { os: windows-2022, tox_env: readme }
7980 steps :
8081 - uses : actions/checkout@v2
81- - name : Setup python
82+ with :
83+ fetch-depth : 0
84+ - name : Setup Python "3.10"
8285 uses : actions/setup-python@v2
8386 with :
84- python-version : 3.10.0-rc.2
87+ python-version : " 3.10"
8588 - name : Install tox
8689 run : python -m pip install tox
87- - name : Run check for ${{ matrix.tox_env }}
88- run : python -m tox -e ${{ matrix.tox_env }}
89- env :
90- UPGRADE_ADVISORY : " yes "
90+ - name : Setup test suite
91+ run : tox -vv --notest -e ${{ matrix.tox_env }}
92+ - name : Run test suite
93+ run : tox --skip-pkg-install -e ${{ matrix.tox_env }}
9194
9295 publish :
9396 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94- needs : [check, test, pre-commit ]
97+ needs : [ check, test ]
9598 runs-on : ubuntu-latest
9699 steps :
97100 - name : Setup python to build package
98101 uses : actions/setup-python@v2
99102 with :
100- python-version : 3.10.0-rc.2
103+ python-version : " 3.10"
101104 - name : Install build
102- run : python -m pip install ' build>=0.4'
105+ run : python -m pip install build
103106 - uses : actions/checkout@v2
104- - name : Build package
107+ with :
108+ fetch-depth : 0
109+ - name : Build sdist and wheel
105110 run : python -m build -s -w . -o dist
106111 - name : Publish to PyPi
107112 uses : pypa/gh-action-pypi-publish@master
0 commit comments