Files
python-kasa/.github/workflows/ci.yml
ZeliardM 494db73fa8 Update GitHub Workflows and Actions (#1622)
This PR is to update the GitHub Workflows and Actions to resolve
residual warnings and errors and using the latest versions available.
2026-02-21 22:09:57 +01:00

90 lines
2.2 KiB
YAML

---
name: CI
on:
push:
branches:
- master
- patch
pull_request:
branches:
- master
- patch
- 'feat/**'
- 'fix/**'
- 'janitor/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
UV_VERSION: 0.9.16
jobs:
lint:
name: Perform Lint Checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.13]
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
cache-pre-commit: true
uv-version: ${{ env.UV_VERSION }}
uv-install-options: --all-extras
- name: Run pre-commit Checks
id: run-pre-commit
shell: bash
run: |
uv run pre-commit run --all-files --verbose
tests:
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
os: [ubuntu-latest, macos-latest, windows-latest]
extras: [false, true]
exclude:
- os: macos-latest
extras: true
- os: windows-latest
extras: true
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
uv-version: ${{ env.UV_VERSION }}
uv-install-options: ${{ matrix.extras == true && '--all-extras' || '' }}
- name: Run PyTests with Code Coverage
id: run-pytests-with-code-coverage
shell: bash
run: |
uv run pytest -n auto --cov kasa --cov-report xml
- name: Upload Code Coverage to Codecov
id: upload-code-coverage-to-codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}