@@ -19,13 +19,23 @@ jobs:
19
19
20
20
steps :
21
21
- uses : " actions/checkout@v4"
22
- - name : Install poetry
23
- run : pipx install poetry
24
22
- uses : " actions/setup-python@v5"
25
23
id : setup-python
26
24
with :
27
25
python-version : " ${{ matrix.python-version }}"
28
- cache : ' poetry'
26
+ - name : Install poetry
27
+ run : pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
28
+ - name : Read poetry cache location
29
+ id : poetry-cache-location
30
+ shell : bash
31
+ run : |
32
+ echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
33
+ - uses : actions/cache@v3
34
+ name : Poetry cache
35
+ with :
36
+ path : |
37
+ ${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
38
+ key : ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}-extras-false
29
39
- name : " Install dependencies"
30
40
run : |
31
41
poetry install
34
44
run : >-
35
45
echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
36
46
- uses : actions/cache@v3
47
+ name : Pre-commit cache
37
48
with :
38
49
path : ~/.cache/pre-commit/
39
50
key : ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -97,18 +108,19 @@ jobs:
97
108
98
109
steps :
99
110
- uses : " actions/checkout@v4"
100
- - name : Install poetry
101
- run : pipx install poetry
102
111
- uses : " actions/setup-python@v5"
103
112
id : setup-python
104
113
with :
105
114
python-version : " ${{ matrix.python-version }}"
115
+ - name : Install poetry
116
+ run : pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
106
117
- name : Read poetry cache location
107
118
id : poetry-cache-location
108
119
shell : bash
109
120
run : |
110
121
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
111
122
- uses : actions/cache@v3
123
+ name : Poetry cache
112
124
with :
113
125
path : |
114
126
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
0 commit comments