mirror of
https://github.com/malmeloo/FindMy.py.git
synced 2026-04-18 07:54:04 +02:00
ci: Use common setup workflow
This commit is contained in:
33
.github/actions/setup-project/action.yml
vendored
Normal file
33
.github/actions/setup-project/action.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Common Python + Poetry Setup
|
||||
|
||||
inputs:
|
||||
dependency-groups:
|
||||
description: 'A comma-separated list of dependency groups to install'
|
||||
default: 'main'
|
||||
python-version:
|
||||
description: 'The Python version to use'
|
||||
default: '3.10'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
|
||||
steps:
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
- name: Load cached venv
|
||||
id: cache-dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-python-${{ inputs.python-version }}-groups-${{ inputs.dependency-groups }}-lock-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-dependencies.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install poetry
|
||||
poetry config virtualenvs.in-project true
|
||||
poetry install --with ${{ inputs.dependency-groups }}
|
||||
Reference in New Issue
Block a user