Skip to content

Commit a13eb2e

Browse files
committed
updated the way we do cash in ci
1 parent af4ddad commit a13eb2e

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
pip3 install poetry
3434
poetry config virtualenvs.in-project true
3535
- name: Set up cache
36-
uses: actions/cache@v3
37-
id: cached-poetry-dependencies
38-
with:
39-
path: .venv
40-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
36+
uses: syphar/restore-virtualenv@v1.2
37+
id: cache-virtualenv
38+
with:
39+
requirement_files: poetry.lock
40+
custom_virtualenv_dir: .venv
4141
- name: Install dependencies
4242
run: poetry install
43-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
43+
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
4444
- name: run tests
4545
run: poetry run pytest -vv tests/*
4646

@@ -69,7 +69,16 @@ jobs:
6969
- name: Print Python Information
7070
run: python -VV
7171
- name: Update dependencies
72-
run: python -m pip install -U pip wheel setuptools twine
72+
run: python -m pip install -U pip wheel setuptools twine poetry
73+
- name: Set up cache
74+
uses: syphar/restore-virtualenv@v1.2
75+
id: cache-virtualenv
76+
with:
77+
requirement_files: poetry.lock
78+
custom_virtualenv_dir: .venv
79+
- name: Install dependencies
80+
run: poetry install
81+
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
7382
- name: Build universal source Archive and wheel
7483
run: poetry build
7584
- name: Upload artifacts

0 commit comments

Comments
 (0)