Code checker #1614
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: Code checker | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "0 4 * * *" | |
jobs: | |
validate: | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: | |
- "3.10" | |
- "3.11" | |
# - "3.12.0-alpha.4" | |
env: | |
SRC_FOLDER: tibber | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install depencency | |
run: | | |
pip install -r requirements.txt | |
pip install dlint black flake8 flake8-bugbear flake8-deprecated flake8-executable isort pylint pytest pytest-cov pytest-asyncio mypy types-python-dateutil | |
- name: Flake8 Code Linter | |
run: | | |
flake8 $SRC_FOLDER | |
- name: isort | |
run: | | |
isort --check-only **/*.py | |
- name: Pylint Code Linter | |
run: | | |
pylint --enable useless-suppression $SRC_FOLDER | |
- name: MyPy | |
run: | | |
mypy --disallow-incomplete-defs --no-implicit-optional --strict --no-warn-return-any $SRC_FOLDER | |
- name: black | |
run: black --check $SRC_FOLDER | |
- name: pytest | |
run: | | |
pytest test/test.py |