mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-04-26 16:46:23 +00:00
Fix CI issue with python version used by pipx to install poetry (#831)
This commit is contained in:
parent
0f3b29183d
commit
5d08a4c074
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@ -19,13 +19,23 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
- name: Install poetry
|
|
||||||
run: pipx install poetry
|
|
||||||
- uses: "actions/setup-python@v5"
|
- uses: "actions/setup-python@v5"
|
||||||
id: setup-python
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.python-version }}"
|
python-version: "${{ matrix.python-version }}"
|
||||||
cache: 'poetry'
|
- name: Install poetry
|
||||||
|
run: pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
|
||||||
|
- name: Read poetry cache location
|
||||||
|
id: poetry-cache-location
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Poetry cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
|
||||||
|
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}-extras-false
|
||||||
- name: "Install dependencies"
|
- name: "Install dependencies"
|
||||||
run: |
|
run: |
|
||||||
poetry install
|
poetry install
|
||||||
@ -34,6 +44,7 @@ jobs:
|
|||||||
run: >-
|
run: >-
|
||||||
echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
|
echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
|
name: Pre-commit cache
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pre-commit/
|
path: ~/.cache/pre-commit/
|
||||||
key: ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
key: ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||||
@ -97,18 +108,19 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
- name: Install poetry
|
|
||||||
run: pipx install poetry
|
|
||||||
- uses: "actions/setup-python@v5"
|
- uses: "actions/setup-python@v5"
|
||||||
id: setup-python
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.python-version }}"
|
python-version: "${{ matrix.python-version }}"
|
||||||
|
- name: Install poetry
|
||||||
|
run: pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
|
||||||
- name: Read poetry cache location
|
- name: Read poetry cache location
|
||||||
id: poetry-cache-location
|
id: poetry-cache-location
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
|
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
|
name: Poetry cache
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
|
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user