mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
a01247d48f
Python 3.11 ships with latest Debian Bookworm. pypy is not that widely used with this library based on statistics. It could be added back when pypy supports python 3.11.
69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["master", "patch"]
|
|
pull_request:
|
|
branches: ["master", "patch"]
|
|
workflow_dispatch: # to allow manual re-runs
|
|
|
|
env:
|
|
UV_VERSION: 0.4.16
|
|
|
|
jobs:
|
|
linting:
|
|
name: "Perform linting checks"
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.13"]
|
|
|
|
steps:
|
|
- name: "Checkout source files"
|
|
uses: "actions/checkout@v4"
|
|
- name: 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"
|
|
run: |
|
|
uv run pre-commit run --all-files --verbose
|
|
|
|
|
|
tests:
|
|
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
|
|
needs: linting
|
|
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:
|
|
- uses: "actions/checkout@v4"
|
|
- name: 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 tests (with coverage)"
|
|
run: |
|
|
uv run pytest -n auto --cov kasa --cov-report xml
|
|
- name: "Upload coverage to Codecov"
|
|
uses: "codecov/codecov-action@v4"
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|