Skip to content

docs: minor fixes and updates for dependencies. #21

docs: minor fixes and updates for dependencies.

docs: minor fixes and updates for dependencies. #21

Workflow file for this run

name: Test
on:
pull_request:
paths:
- '.github/workflows/tests.yml'
- 'tests/requirements-*.txt'
- 'pyproject.toml'
- '**.py'
types:
- 'opened'
- 'synchronize'
push:
branches:
- 'master'
paths:
- '.github/workflows/tests.yml'
- 'tests/requirements-*.txt'
- 'pyproject.toml'
- '**.py'
workflow_dispatch:
jobs:
test:
name: Test aio-ld2410 using pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 3.9 was removed from this matrix due to an issue with the test framework.
# This is not worth investigating more since it will be unsupported "soon".
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install testing dependencies
run: make install-testing
- name: PyTest
run: pytest --cov=aio_ld2410 -v -s --junit-xml=pytest.xml --cov-report=term --cov-report=xml
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: Test results (Python ${{ matrix.python-version }})
path: pytest.xml
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: Coverage results (Python ${{ matrix.python-version }})
path: coverage.xml
- name: Publish coverage results to Codecov
uses: codecov/codecov-action@v4
with:
name: Coverage with Python ${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
fail_ci_if_error: true
file: ./coverage.xml
disable_search: true
flags: unittests
verbose: true
publish-test-results:
name: Publish tests results
needs:
- test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: 'artifacts/**/pytest.xml'
mypy:
name: Check typing using MyPy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install linting dependencies
run: make install-package install-linting
- name: MyPy
run: mypy --junit-xml=mypy.xml
- name: Upload type checking results
uses: actions/upload-artifact@v4
with:
name: Type checking results (Python ${{ matrix.python-version }})
path: mypy.xml
ruff:
name: Check linting and formatting using ruff
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install linting dependencies
run: make install-linting
- name: Run ruff with linting checks
run: ruff check --output-format=github
- name: Run ruff with format checks
run: ruff format --check --diff