mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-07-08 23:01:54 +00:00
Some checks failed
CI / Perform Lint Checks (3.13) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
Stale / stale (push) Has been cancelled
Update action versions and pin to full SHA commit hashes. Windows build parallelization is disabled to avoid hung CI.
44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
---
|
|
name: Setup Environment
|
|
description: Install uv, configure the system python, and the package dependencies
|
|
inputs:
|
|
uv-install-options:
|
|
default: ""
|
|
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@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
|
|
with:
|
|
enable-cache: true
|
|
version-file: uv.lock
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
- 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@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
|
|
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-uv.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|