mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-02-28 13:49:57 +00:00
This PR is to update the GitHub Workflows and Actions to resolve residual warnings and errors and using the latest versions available.
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
---
|
|
name: Setup Environment
|
|
description: Install uv, configure the system python, and the package dependencies
|
|
inputs:
|
|
uv-install-options:
|
|
default: ""
|
|
uv-version:
|
|
default: 0.9.16
|
|
python-version:
|
|
required: true
|
|
cache-pre-commit:
|
|
default: false
|
|
cache-version:
|
|
default: "v0.1"
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Setup uv
|
|
id: setup-uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Setup Python
|
|
id: setup-python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
allow-prereleases: true
|
|
|
|
- name: Install Project Dependencies
|
|
id: install-project-dependencies
|
|
shell: bash
|
|
run: |
|
|
uv sync ${{ inputs.uv-install-options }}
|
|
|
|
- name: Read pre-commit Version
|
|
id: pre-commit-version
|
|
if: inputs.cache-pre-commit == 'true'
|
|
shell: bash
|
|
run: >-
|
|
echo "pre-commit-version=$(uv run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
|
|
|
|
- name: pre-commit Cache
|
|
id: pre-commit-cache
|
|
if: inputs.cache-pre-commit == 'true'
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pre-commit/
|
|
key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|