Files
python-kasa/.github/workflows/ci.yml
Teemu R. 38a3184de6
Some checks failed
Stale / stale (push) Has been cancelled
CI / Perform Lint Checks (3.14) (push) Has been cancelled
CodeQL Checks / Analyze (python) (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.14 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.14 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
CI / Python 3.14 on windows-latest (push) Has been cancelled
Build and check packages in CI and publish workflows (#1782)
The 0.11.0 upload failed only after the release was tagged and
published, which burned the version number due to immutable releases
(see #1779).

- Add a local `build-packages` action that builds the packages with the
release build constraints and runs `twine check --strict` on them.
- Run it in the lint job, so packaging issues are caught on every PR.
- Use the same action in the publish workflow.
2026-10-09 21:46:57 +02:00

94 lines
2.6 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
jobs:
lint:
name: Perform Lint Checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.14]
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
cache-pre-commit: true
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
# Build the same way as publish.yml to catch packaging issues before a release is tagged.
- name: Build and Check Packages
id: build-packages
uses: ./.github/actions/build-packages
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, 3.14]
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
uv-install-options: ${{ matrix.extras == true && '--all-extras' || '' }}
- name: Run PyTests with Code Coverage
id: run-pytests-with-code-coverage
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
uv run pytest -n0 --cov kasa --cov-report xml
else
uv run pytest -n auto --cov kasa --cov-report xml
fi
- name: Upload Code Coverage to Codecov
id: upload-code-coverage-to-codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}