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