@@ -10,47 +10,49 @@ concurrency:
10
10
cancel-in-progress : true
11
11
12
12
jobs :
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
-
20
13
test :
21
14
name : test ${{ matrix.py }} - ${{ matrix.os }}
22
- runs-on : ${{ matrix.os }}-latest
15
+ runs-on : ${{ matrix.os }}
23
16
strategy :
24
17
fail-fast : false
25
18
matrix :
26
- os :
27
- - Ubuntu
28
- - Windows
29
- - MacOs
30
19
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
+
36
30
steps :
37
31
- name : Setup python for tox
38
32
uses : actions/setup-python@v2
39
33
with :
40
- python-version : 3.10.0-rc.2
34
+ python-version : " 3.10"
41
35
- name : Install tox
42
36
run : python -m pip install tox
43
37
- uses : actions/checkout@v2
38
+ with :
39
+ fetch-depth : 0
44
40
- name : Setup python for test ${{ matrix.py }}
45
41
uses : actions/setup-python@v2
46
42
with :
47
43
python-version : ${{ matrix.py }}
48
44
- name : Pick environment to run
49
45
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)
54
56
shell : python
55
57
- name : Setup test suite
56
58
run : tox -vv --notest
@@ -61,47 +63,50 @@ jobs:
61
63
CI_RUN : " yes"
62
64
63
65
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 }}
66
68
strategy :
67
69
fail-fast : false
68
70
matrix :
69
71
os :
70
- - Ubuntu
71
- - Windows
72
+ - ubuntu-20.04
73
+ - windows-2022
72
74
tox_env :
73
- - type
74
75
- dev
75
- - pkg_desc
76
+ - type
77
+ - readme
76
78
exclude :
77
- - { os: Windows, tox_env: pkg_desc }
78
-
79
+ - { os: windows-2022, tox_env: readme }
79
80
steps :
80
81
- uses : actions/checkout@v2
81
- - name : Setup python
82
+ with :
83
+ fetch-depth : 0
84
+ - name : Setup Python "3.10"
82
85
uses : actions/setup-python@v2
83
86
with :
84
- python-version : 3.10.0-rc.2
87
+ python-version : " 3.10"
85
88
- name : Install tox
86
89
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 }}
91
94
92
95
publish :
93
96
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94
- needs : [check, test, pre-commit ]
97
+ needs : [ check, test ]
95
98
runs-on : ubuntu-latest
96
99
steps :
97
100
- name : Setup python to build package
98
101
uses : actions/setup-python@v2
99
102
with :
100
- python-version : 3.10.0-rc.2
103
+ python-version : " 3.10"
101
104
- name : Install build
102
- run : python -m pip install ' build>=0.4'
105
+ run : python -m pip install build
103
106
- uses : actions/checkout@v2
104
- - name : Build package
107
+ with :
108
+ fetch-depth : 0
109
+ - name : Build sdist and wheel
105
110
run : python -m build -s -w . -o dist
106
111
- name : Publish to PyPi
107
112
uses : pypa/gh-action-pypi-publish@master
0 commit comments