From bcfca39c5df2a9f8832ea02b46f5593a3638d090 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 11:21:32 -1000 Subject: [PATCH] Ensure we are testing on MacOS and Windows (#933) --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16ef29f4..fd6e4729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -53,6 +73,7 @@ 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 . @@ -60,10 +81,12 @@ jobs: 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" @@ -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 @@ -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' }}