mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-30 17:15:08 +08:00
41 lines
911 B
YAML
41 lines
911 B
YAML
name: Setup Python
|
|
description: Setup Python
|
|
|
|
inputs:
|
|
python-version:
|
|
description: Python version
|
|
required: false
|
|
default: "3.10"
|
|
env-dir:
|
|
description: Environment directory
|
|
required: false
|
|
default: "."
|
|
no-root:
|
|
description: Do not install package in the environment
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Install poetry
|
|
run: pipx install poetry
|
|
shell: bash
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
cache: "poetry"
|
|
cache-dependency-path: |
|
|
./poetry.lock
|
|
${{ inputs.env-dir }}/poetry.lock
|
|
|
|
- run: |
|
|
cd ${{ inputs.env-dir }}
|
|
if [ "${{ inputs.no-root }}" = "true" ]; then
|
|
poetry install --all-extras --no-root
|
|
else
|
|
poetry install --all-extras
|
|
fi
|
|
shell: bash
|