I tried based on Sylvain's answer, but cache did not work. Here is a working version as of February 2025.
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |
pipx install poetry==1.8.*
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- run: poetry install
- run: poetry run pytest