Make sure cache directory exists for miotcloud #1504
Workflow file for this run
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.10"] | |
steps: | |
- uses: "actions/checkout@v3" | |
- 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 pyupgrade" | |
run: | | |
poetry run pre-commit run pyupgrade --all-files | |
- name: "Code formating (black)" | |
run: | | |
poetry run pre-commit run black --all-files | |
- name: "Code formating (flake8)" | |
run: | | |
poetry run pre-commit run flake8 --all-files | |
- name: "Order of imports (isort)" | |
run: | | |
poetry run pre-commit run isort --all-files | |
- name: "Docstring formating (docformatter)" | |
run: | | |
poetry run pre-commit run docformatter --all-files | |
- name: "Potential security issues (bandit)" | |
run: | | |
poetry run pre-commit run bandit --all-files | |
- name: "Documentation build (sphinx)" | |
run: | | |
poetry run sphinx-build docs/ generated_docs | |
- name: "Typing checks (mypy)" | |
run: | | |
poetry run pre-commit run mypy --all-files | |
tests: | |
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}" | |
needs: linting | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy3.8"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
# test pypy3 only on ubuntu as cryptography requires rust compilation | |
# which slows the pipeline and was not currently working on macos | |
exclude: | |
- python-version: pypy3.8 | |
os: macos-latest | |
- python-version: pypy3.8 | |
os: windows-latest | |
- python-version: 3.11-dev | |
os: macos-latest | |
- python-version: 3.11-dev | |
os: windows-latest | |
steps: | |
- uses: "actions/checkout@v3" | |
- 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 tests" | |
run: | | |
poetry run pytest --cov miio --cov-report xml | |
- name: "Upload coverage to Codecov" | |
uses: "codecov/codecov-action@v3" | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |