Skip to content

Commit 57fff2b

Browse files
committed
Added arch and poetry lock sha to Cache key.
1 parent e01bdc4 commit 57fff2b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/actions/python-environment/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,20 @@ runs:
5757
echo "ImageOS=$ImageOS"
5858
echo "ImageVersion=$ImageVersion"
5959
POETRY_ENV_PATH=$(poetry config virtualenvs.path)
60+
POETRY_SHA=$((sha256sum poetry.lock | awk '{print $1}') #Remove trailing filename
6061
echo "POETRY_ENV_PATH=$POETRY_ENV_PATH" >> $GITHUB_OUTPUT
6162
echo "IMAGE_OS=$ImageOS" >> $GITHUB_OUTPUT
6263
echo "IMAGE_VERSION=$ImageVersion" >> $GITHUB_OUTPUT
64+
echo "POETRY_SHA=$POETRY_SHA" >> $GITHUB_OUTPUT
65+
6366
6467
- name: Cache Poetry environment
6568
if: inputs.use-cache == 'true'
6669
id: cache-poetry-env
6770
uses: actions/cache@v4
6871
with:
6972
path: ${{ steps.setup-cache-variables.outputs.POETRY_ENV_PATH }}
70-
key: poetry-env-${{ steps.setup-cache-variables.outputs.IMAGE_OS }}-${{ steps.setup-cache-variables.outputs.IMAGE_VERSION }}-${{ inputs.poetry-version }}-${{ inputs.python-version }}-${{ inputs.extras }}
73+
key: poetry-env-${{ steps.setup-cache-variables.outputs.POETRY_SHA }}-${{ steps.setup-cache-variables.outputs.IMAGE_OS }}-${{ steps.setup-cache-variables.outputs.IMAGE_VERSION }}-${{ runner.arch }}-${{ inputs.poetry-version }}-${{ inputs.python-version }}-${{ inputs.extras }}
7174

7275
- name: Poetry install with extras
7376
if: inputs.use-cache != 'true' || steps.cache-poetry-env.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)