Skip to content

Commit a0887be

Browse files
committed
CI(GHActions): Switch to setup-miniconda
1 parent 1c8100c commit a0887be

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

.github/workflows/run-tests.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
strategy:
1111
matrix:
1212
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+
1415
include:
1516
- os: ubuntu-latest
1617
os-name: Linux
@@ -26,15 +27,19 @@ jobs:
2627

2728
# Setup Python/pip
2829
- uses: actions/checkout@v4
29-
- uses: s-weigand/setup-conda@v1
30+
- uses: conda-incubator/setup-miniconda@v3
3031
with:
31-
conda-channels: conda-forge
32+
miniforge-version: latest
3233
python-version: ${{ matrix.python-version }}
3334
if: ${{ !contains(fromJSON(env.not_in_conda), matrix.python-version) }}
3435
- uses: actions/setup-python@v4
3536
with:
3637
python-version: ${{ matrix.python-version }}
3738
if: ${{ contains(fromJSON(env.not_in_conda), matrix.python-version) }}
39+
- uses: actions/cache@v3
40+
with:
41+
path: ~/conda_pkgs_dir
42+
key: ${{ runner.os }}-conda
3843
- name: Cache pip
3944
uses: actions/cache@v3
4045
with:
@@ -49,29 +54,32 @@ jobs:
4954
python -m pip install --upgrade pip setuptools wheel
5055
pip --version
5156
pip install --upgrade virtualenv "tox >= 3.15, < 4"
57+
shell: bash -el {0}
5258
- name: Set TOXENV
5359
run: |
60+
python -c "
5461
import os, sys
5562
ld_library_path = None
5663
if hasattr(sys, 'pypy_version_info'):
57-
toxenv = 'pypy3'
64+
toxenv = 'pypy3'
5865
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
66+
pyver = '%d%d' % tuple(sys.version_info[:2])
67+
if (pyver == '27') and (os.name == 'posix'): # Python 2.7 on Linux requires `$LD_LIBRARY_PATH`
68+
ld_library_path = os.path.join(
69+
os.path.dirname(os.path.dirname(sys.executable)), 'lib')
70+
toxenv = 'py%s' % pyver
71+
if os.name == 'posix':
72+
toxenv += ',py%s-flake8' % pyver
6773
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
74+
if ld_library_path:
75+
f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n')
76+
f.write('TOXENV=' + toxenv + '\n')
77+
"
78+
shell: bash -el {0}
7279

7380
- name: Run tox
7481
run: |
7582
python -c "import os; print(os.environ['TOXENV'])"
7683
tox --version
7784
tox
85+
shell: bash -el {0}

docs/news.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Version 0.8.1 (in development)
88

99
* CI(GHActions): Install all Python and PyPy versions from ``conda-forge``.
1010

11+
* CI(GHActions): Switch to ``setup-miniconda``.
12+
1113
Version 0.8.0 (2021-09-24)
1214
--------------------------
1315

0 commit comments

Comments
 (0)