Skip to content

Commit dc42bfb

Browse files
committed
CI: Simplify virtualenv setup with an action
1 parent 07163a3 commit dc42bfb

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,17 @@ jobs:
2727
- name: Download source
2828
uses: actions/checkout@v2
2929
- name: Install Python
30-
id: python
3130
uses: actions/setup-python@v2
3231
with:
3332
python-version: ${{matrix.python}}
3433
- name: Pin to lowest versions
3534
if: matrix.versions == 'minimal'
3635
run: |
3736
sed -i -E 's/"(\^|>=)([0-9])/"==\2/' pyproject.toml
38-
- name: Cache packages
39-
uses: actions/cache@v2
37+
- name: Setup virtualenv
38+
uses: syphar/restore-virtualenv@d0a933d92488e0505e012c3367e3f987a6276f5a
4039
with:
41-
path: .venv
42-
key: venv-${{matrix.os}}-py${{steps.python.outputs.python-version}}-${{hashFiles('pyproject.toml')}}
43-
restore-keys: venv-${{matrix.os}}-py${{steps.python.outputs.python-version}}-
44-
- name: Create virtualenv
45-
run: |
46-
python -m venv .venv
47-
py=($(pwd)/.venv/*/python*); dirname $py >>$GITHUB_PATH
40+
requirement_files: pyproject.toml
4841
- name: Install packages
4942
run: |
5043
python -m pip install -U pip'>=19'; pip install -U wheel

0 commit comments

Comments
 (0)