Skip to content

Commit 9c1757b

Browse files
authored
CI: testing impact of poetry.lock (#92)
* CI: testing impact of poetry.lock * attempt at caching the installed dependencies * figuring out the correct syntax * test * fix? * Empty-Commit: test caching * caching without commiting poetry.lock * syntax * should not use old caches: otherwise we always use the same old lock file * bump mypy to cause cache miss * on cache miss: keep venv but delete old poetry.lock * delete lock file on cache miss
1 parent 4918487 commit 9c1757b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ jobs:
2626
- name: Install Poetry
2727
run: pip install poetry
2828

29+
- name: Determine poetry cache-dir
30+
run: |
31+
echo "::set-output name=PATH::$(poetry config cache-dir)"
32+
id: cache_path
33+
34+
- name: Cache project dependencies
35+
id : cache
36+
uses: actions/cache@v3
37+
with:
38+
path: |
39+
${{ steps.cache_path.outputs.PATH }}
40+
poetry.lock
41+
key: ${{ matrix.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('pyproject.toml') }}
42+
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-poetry-
43+
44+
- name: Delete poetry.lock on cache miss
45+
if: steps.cache.outputs.cache-hit != 'true'
46+
uses: JesseTG/[email protected]
47+
with:
48+
path: poetry.lock
49+
2950
- name: Install project dependencies
3051
run: poetry install -vvv --no-root
3152

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ python = ">=3.8,<3.11"
3636
[tool.poetry.dev-dependencies]
3737
mypy = ">=0.960"
3838
pytest = ">=7.1.2"
39-
pyright = ">=1.1.251"
39+
pyright = ">=1.1.255"
4040
poethepoet = ">=0.13.1"
4141
loguru = ">=0.6.0"
4242
pandas = "1.4.3"

0 commit comments

Comments
 (0)