Use ruff for formatting (#1980) #1711
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
workflow_dispatch: # to allow manual re-runs | |
jobs: | |
linting: | |
name: "Perform linting checks" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- uses: "actions/checkout@v4" | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --upgrade pip poetry | |
poetry install --extras docs | |
- name: "Run pre-commit hooks" | |
run: | | |
poetry run pre-commit run --all-files --verbose | |
tests: | |
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}" | |
needs: linting | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: "actions/checkout@v4" | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --upgrade pip poetry | |
poetry install --all-extras | |
- name: "Run tests" | |
run: | | |
poetry run pytest --cov miio --cov-report xml | |
- name: "Upload coverage to Codecov" | |
uses: "codecov/codecov-action@v4" | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |