.github/actions/prepare/action.yml
name: Prepare
description:
inputs:
python-version:
required: true
poetry-version:
required: true
outputs:
cache-matched-key:
value: ${{ steps.restore-cache.outputs.cache-matched-key }}
runs:
using: "composite"
steps:
- name: Restore cached Poetry installation and its cache
id: restore-cache
uses: actions/cache/restore@v3
with:
path: |
~/.cache/pipx/venvs
~/.local/bin
~/.cache/pypoetry/
key: ignore-me
restore-keys: |
poetry-installation-and-cache-${{ inputs.python-version }}-${{ inputs.poetry-version }}-
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 # v4.4.0
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
shell: bash
run: |
pipx install poetry==${{ inputs.poetry-version }}
poetry env use ${{ inputs.python-version }}