10
10
strategy :
11
11
matrix :
12
12
os : [ubuntu-latest, windows-latest]
13
- python-version : ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.7"]
13
+ python-version : ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "=3.9[build=*_pypy]"]
14
+
15
+ name : Python ${{ matrix.python-version }}
16
+ runs-on : ubuntu-latest
14
17
include :
15
18
- os : ubuntu-latest
16
19
os-name : Linux
@@ -26,15 +29,19 @@ jobs:
26
29
27
30
# Setup Python/pip
28
31
- uses : actions/checkout@v4
29
- - uses : s-weigand /setup-conda@v1
32
+ - uses : conda-incubator /setup-miniconda@v3
30
33
with :
31
- conda-channels : conda-forge
34
+ miniforge-version : latest
32
35
python-version : ${{ matrix.python-version }}
33
36
if : ${{ !contains(fromJSON(env.not_in_conda), matrix.python-version) }}
34
37
- uses : actions/setup-python@v4
35
38
with :
36
39
python-version : ${{ matrix.python-version }}
37
40
if : ${{ contains(fromJSON(env.not_in_conda), matrix.python-version) }}
41
+ - uses : actions/cache@v3
42
+ with :
43
+ path : ~/conda_pkgs_dir
44
+ key : ${{ runner.os }}-conda
38
45
- name : Cache pip
39
46
uses : actions/cache@v3
40
47
with :
@@ -49,29 +56,32 @@ jobs:
49
56
python -m pip install --upgrade pip setuptools wheel
50
57
pip --version
51
58
pip install --upgrade virtualenv "tox >= 3.15, < 4"
59
+ shell : ${{ runner.os = 'Windows' && 'cmd /C call {0}' || 'bash -el {0}' }}
52
60
- name : Set TOXENV
53
61
run : |
62
+ python -c "
54
63
import os, sys
55
64
ld_library_path = None
56
65
if hasattr(sys, 'pypy_version_info'):
57
- toxenv = 'pypy3'
66
+ toxenv = 'pypy3'
58
67
else:
59
- pyver = '%d%d' % tuple(sys.version_info[:2])
60
- if os.name == 'posix':
61
- if pyver == '27': # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
62
- ld_library_path = os.path.join(
63
- os.path.dirname(os.path.dirname(sys.executable)), 'lib')
64
- toxenv = 'py%s' % pyver
65
- if os.name == 'posix':
66
- toxenv += ',py%s-flake8' % pyver
68
+ pyver = '%d%d' % tuple(sys.version_info[:2])
69
+ if (pyver == '27') and (os.name == 'posix'): # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
70
+ ld_library_path = os.path.join(
71
+ os.path.dirname(os.path.dirname(sys.executable)), 'lib')
72
+ toxenv = 'py%s' % pyver
73
+ if os.name == 'posix':
74
+ toxenv += ',py%s-flake8' % pyver
67
75
with open(os.environ['GITHUB_ENV'], 'a') as f:
68
- if ld_library_path:
69
- f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
70
- f.write('TOXENV=' + toxenv + '\n')
71
- shell : python
76
+ if ld_library_path:
77
+ f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
78
+ f.write('TOXENV=' + toxenv + '\n')
79
+ "
80
+ shell : ${{ runner.os = 'Windows' && 'cmd /C call {0}' || 'bash -el {0}' }}
72
81
73
82
- name : Run tox
74
83
run : |
75
84
python -c "import os; print(os.environ['TOXENV'])"
76
85
tox --version
77
86
tox
87
+ shell : ${{ runner.os = 'Windows' && 'cmd /C call {0}' || 'bash -el {0}' }}
0 commit comments