@@ -21,92 +21,53 @@ jobs:
21
21
strategy :
22
22
fail-fast : false
23
23
matrix :
24
- include :
25
- # Linux
26
- - tox_env : " py39-coverage"
27
- python : " 3.9"
28
- os : ubuntu-20.04
29
- - tox_env : " py38-coverage"
30
- python : " 3.8"
31
- os : ubuntu-20.04
32
- - tox_env : " py37-coverage"
33
- python : " 3.7"
34
- os : ubuntu-20.04
35
- - tox_env : " py36-coverage"
36
- python : " 3.6"
37
- os : ubuntu-20.04
38
- - tox_env : " py35-coverage"
39
- python : " 3.5"
40
- os : ubuntu-20.04
41
-
42
- - tox_env : " py27-coverage"
43
- python : " 2.7"
44
- os : ubuntu-20.04
45
-
46
- - tox_env : " pypy3-coverage"
47
- python : " pypy-3.7"
48
- os : ubuntu-20.04
49
- - tox_env : " pypy-coverage"
50
- python : " pypy-2.7"
51
- os : ubuntu-20.04
24
+ os : [ubuntu-latest]
25
+ python : ["3.8", "3.9", "3.10", "3.11"]
52
26
53
27
steps :
54
- - uses : actions/checkout@v2
55
- with :
56
- fetch-depth : 0
28
+ - uses : actions/checkout@v4
57
29
- name : Set up Python ${{ matrix.python }}
58
- uses : actions/setup-python@v2
30
+ uses : actions/setup-python@v4
59
31
with :
60
32
python-version : ${{ matrix.python }}
61
33
62
- # Caching.
34
+ - name : Set tox_env
35
+ run : |
36
+ pyv=$(echo ${{matrix.python}} | sed 's/.//')
37
+ tox_env=py${pyv}-coverage
38
+ echo "tox env name: ${tox_env}"
39
+ echo "tox_env=${tox_env}">> $GITHUB_ENV
40
+
63
41
- name : set PY_CACHE_KEY
64
42
run : echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
65
43
- name : Cache .tox
66
- uses : actions/cache@v1
44
+ uses : actions/cache@v3
67
45
with :
68
- path : ${{ github.workspace }}/.tox/${{ matrix .tox_env }}
69
- key : " tox|${{ matrix.os }}|${{ matrix .tox_env }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}"
46
+ path : ${{ github.workspace }}/.tox/${{ env .tox_env }}
47
+ key : " tox|${{ matrix.os }}|${{ env .tox_env }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}"
70
48
71
- - name : (Initial) version information/pinning
49
+ - name : Install/update tools
72
50
run : |
73
- set -x
74
- python -m site
75
- python -m pip --version
76
- python -m pip list
77
- if [[ "${{ matrix.python }}" == "3.4" ]]; then
78
- # Install latest available pip.
79
- # 7.1.2 (installed) is too old to not install too new packages,
80
- # including pip itself. 19.2 dropped support for Python 3.4.
81
- python -m pip install -U pip==19.1.1
82
- fi
83
- python -m pip install -U setuptools==42.0.2
84
- python -m pip install -U virtualenv==20.4.3
85
-
86
- - name : Install tox
87
- run : python -m pip install git+https://github.com/blueyed/tox@master
88
-
89
- - name : Version information
90
- run : python -m pip list
51
+ pip install -U pip setuptools virtualenv tox
91
52
92
53
- name : Setup tox environment
93
54
id : setup-tox
94
- run : python -m tox --notest -v --durations - e ${{ matrix .tox_env }}
55
+ run : tox --notest -v -e ${{ env .tox_env }}
95
56
96
57
- name : Test
97
58
env :
98
- COLUMNS : " 90" # better alignment (working around https://github.com/blueyed/pytest/issues/491).
59
+ COLUMNS : " 90" # better alignment (working around https://github.com/blueyed/pytest/issues/491).
99
60
PY_COLORS : " 1"
100
61
# UTF-8 mode for Windows (https://docs.python.org/3/using/windows.html#utf-8-mode).
101
62
PYTHONUTF8 : " 1"
102
63
TOX_TESTENV_PASSENV : " PYTHONUTF8"
103
- run : python -m tox -v --durations -e ${{ matrix .tox_env }}
64
+ run : tox -v --durations -e ${{ env .tox_env }}
104
65
105
66
- name : Report coverage
106
- if : always() && (steps.setup-tox.outcome == 'success' && contains(matrix .tox_env, '-coverage'))
107
- uses : codecov/codecov-action@v1
67
+ if : always() && (steps.setup-tox.outcome == 'success' && contains(env .tox_env, '-coverage'))
68
+ uses : codecov/codecov-action@v3
108
69
with :
109
70
files : ./coverage.xml
110
71
flags : ${{ runner.os }}
111
- name : ${{ matrix .tox_env }}
72
+ name : ${{ env .tox_env }}
112
73
fail_ci_if_error : true
0 commit comments