2022-01-13 16:41:01 +08:00
|
|
|
name: Setup Python
|
|
|
|
description: Setup Python
|
|
|
|
|
2022-01-13 17:58:35 +08:00
|
|
|
inputs:
|
|
|
|
python-version:
|
|
|
|
description: Python version
|
|
|
|
required: false
|
2022-08-14 19:41:00 +08:00
|
|
|
default: "3.10"
|
2024-01-26 11:12:57 +08:00
|
|
|
env-dir:
|
|
|
|
description: Environment directory
|
|
|
|
required: false
|
|
|
|
default: "."
|
|
|
|
no-root:
|
|
|
|
description: Do not install package in the environment
|
|
|
|
required: false
|
|
|
|
default: "false"
|
2022-01-13 17:58:35 +08:00
|
|
|
|
2022-01-13 16:41:01 +08:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2022-11-04 09:29:13 +08:00
|
|
|
- name: Install poetry
|
2023-04-01 19:47:33 +08:00
|
|
|
run: pipx install poetry
|
2022-05-27 11:25:51 +08:00
|
|
|
shell: bash
|
|
|
|
|
2023-12-08 13:26:19 +08:00
|
|
|
- uses: actions/setup-python@v5
|
2022-01-13 16:41:01 +08:00
|
|
|
with:
|
2022-11-04 09:29:13 +08:00
|
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
architecture: "x64"
|
|
|
|
cache: "poetry"
|
2024-01-26 11:12:57 +08:00
|
|
|
cache-dependency-path: |
|
|
|
|
./poetry.lock
|
|
|
|
${{ inputs.env-dir }}/poetry.lock
|
2022-01-13 16:41:01 +08:00
|
|
|
|
2024-01-26 11:12:57 +08:00
|
|
|
- run: |
|
|
|
|
cd ${{ inputs.env-dir }}
|
|
|
|
if [ "${{ inputs.no-root }}" = "true" ]; then
|
|
|
|
poetry install --all-extras --no-root
|
|
|
|
else
|
|
|
|
poetry install --all-extras
|
|
|
|
fi
|
2022-01-13 16:41:01 +08:00
|
|
|
shell: bash
|