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