Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,28 @@ jobs:
- "3.12"
os:
- ubuntu-latest
- windows-latest
- macos-latest
extension:
- "skip_cython"
- "use_cython"
exclude:
- python-version: "3.9"
os: windows-latest
- python-version: "3.10"
os: windows-latest
- python-version: "3.11"
os: windows-latest
- python-version: "3.9"
os: macos-latest
- python-version: "3.10"
os: macos-latest
- python-version: "3.11"
os: macos-latest
- extension: "use_cython"
os: windows-latest
- extension: "use_cython"
os: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -40,6 +59,7 @@ jobs:

- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Restore PIP cache
Expand All @@ -53,17 +73,20 @@ jobs:
if: ${{ matrix.extension == 'skip_cython' }}
env:
SKIP_CYTHON: 1
shell: bash
run: |
pip3 install -r requirements.txt -r requirements_test.txt
pip3 install -e .
- name: Set up Python environment (cython)
if: ${{ matrix.extension == 'use_cython' }}
env:
REQUIRE_CYTHON: 1
shell: bash
run: |
pip3 install -r requirements.txt -r requirements_test.txt
pip3 install -e .
- name: Register problem matchers
shell: bash
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
echo "::add-matcher::.github/workflows/matchers/pylint.json"
Expand All @@ -72,16 +95,16 @@ jobs:

- run: flake8 aioesphomeapi
name: Lint with flake8
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }}
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}
- run: pylint aioesphomeapi
name: Lint with pylint
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }}
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}
- run: ruff check aioesphomeapi tests
name: Check formatting with ruff
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }}
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}
- run: mypy aioesphomeapi
name: Check typing with mypy
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }}
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}
- run: pytest -vv --cov=aioesphomeapi --cov-report=xml --tb=native tests
name: Run tests with pytest
- name: Upload coverage to Codecov
Expand All @@ -98,4 +121,4 @@ jobs:
exit 1
fi
name: Check protobuf files match
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }}
if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }}