action.yml 966 B

123456789101112131415161718192021222324252627282930313233343536
  1. name: Setup Poetry and Python
  2. inputs:
  3. python-version:
  4. description: Python version to use and the Poetry installed with
  5. required: true
  6. default: '3.11'
  7. poetry-version:
  8. description: Poetry version to set up
  9. required: true
  10. default: '2.0.1'
  11. poetry-lockfile:
  12. description: Path to the Poetry lockfile to restore cache from
  13. required: true
  14. default: ''
  15. runs:
  16. using: composite
  17. steps:
  18. - name: Set up Python ${{ inputs.python-version }}
  19. uses: actions/setup-python@v5
  20. with:
  21. python-version: ${{ inputs.python-version }}
  22. cache: pip
  23. - name: Install Poetry
  24. shell: bash
  25. run: pip install poetry==${{ inputs.poetry-version }}
  26. - name: Restore Poetry cache
  27. if: ${{ inputs.poetry-lockfile != '' }}
  28. uses: actions/setup-python@v5
  29. with:
  30. python-version: ${{ inputs.python-version }}
  31. cache: poetry
  32. cache-dependency-path: ${{ inputs.poetry-lockfile }}