Fix Poetry cache path for proper dependency caching

Changed cache configuration:
- Moved Install Poetry step before cache setup
- Updated cache path to ~/.cache/pypoetry/virtualenvs (actual venv location)
- Removed **/poetry.lock wildcard in favor of direct poetry.lock reference
- This ensures the virtualenv itself is cached, not just metadata

This should significantly speed up CI/CD runs by reusing installed packages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Alexis Bruneteau 2025-10-01 18:53:40 +02:00
parent c9dbe70bdb
commit 8dc524af22

View File

@ -17,19 +17,19 @@ jobs:
with: with:
python-version: '3.12' python-version: '3.12'
- name: Cache Poetry dependencies - name: Install Poetry
run: pip install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: | path: |
~/.cache/pypoetry ~/.cache/pypoetry/virtualenvs
~/.cache/pip ~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-poetry- ${{ runner.os }}-poetry-
- name: Install Poetry
run: pip install poetry
- name: Install dependencies - name: Install dependencies
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root
@ -63,19 +63,19 @@ jobs:
with: with:
python-version: '3.12' python-version: '3.12'
- name: Cache Poetry dependencies - name: Install Poetry
run: pip install poetry
- name: Cache Poetry virtualenv
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: | path: |
~/.cache/pypoetry ~/.cache/pypoetry/virtualenvs
~/.cache/pip ~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-poetry- ${{ runner.os }}-poetry-
- name: Install Poetry
run: pip install poetry
- name: Install dependencies - name: Install dependencies
run: poetry install --no-interaction --no-root run: poetry install --no-interaction --no-root