@@ -21,92 +21,53 @@ jobs:
2121 strategy :
2222 fail-fast : false
2323 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"]
5226
5327 steps :
54- - uses : actions/checkout@v2
55- with :
56- fetch-depth : 0
28+ - uses : actions/checkout@v4
5729 - name : Set up Python ${{ matrix.python }}
58- uses : actions/setup-python@v2
30+ uses : actions/setup-python@v4
5931 with :
6032 python-version : ${{ matrix.python }}
6133
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+
6341 - name : set PY_CACHE_KEY
6442 run : echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
6543 - name : Cache .tox
66- uses : actions/cache@v1
44+ uses : actions/cache@v3
6745 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.*') }}"
7048
71- - name : (Initial) version information/pinning
49+ - name : Install/update tools
7250 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
9152
9253 - name : Setup tox environment
9354 id : setup-tox
94- run : python -m tox --notest -v --durations - e ${{ matrix .tox_env }}
55+ run : tox --notest -v -e ${{ env .tox_env }}
9556
9657 - name : Test
9758 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).
9960 PY_COLORS : " 1"
10061 # UTF-8 mode for Windows (https://docs.python.org/3/using/windows.html#utf-8-mode).
10162 PYTHONUTF8 : " 1"
10263 TOX_TESTENV_PASSENV : " PYTHONUTF8"
103- run : python -m tox -v --durations - e ${{ matrix .tox_env }}
64+ run : tox -v -e ${{ env .tox_env }}
10465
10566 - 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
10869 with :
10970 files : ./coverage.xml
11071 flags : ${{ runner.os }}
111- name : ${{ matrix .tox_env }}
72+ name : ${{ env .tox_env }}
11273 fail_ci_if_error : true
0 commit comments