Code checker #2240
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.11" | |
- "3.12" | |
env: | |
SRC_FOLDER: tibber | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependency | |
run: | | |
pip install -r requirements.txt | |
pip install mypy pre-commit pytest pytest-asyncio pytest-cov ruff | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
run: pre-commit run --all-files --show-diff-on-failure --color=always | |
shell: bash | |
- name: pytest | |
run: | | |
pytest |