Add EV charger sensor support #252
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| # branches: [ main, master ] | |
| schedule: | |
| # Run tests daily at 6 AM UTC to catch dependency issues | |
| - cron: '0 6 * * *' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.13'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: '**/requirements.test.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.test.txt | |
| - name: Run tests with coverage | |
| run: | | |
| pytest tests/ --cov=custom_components.sems --cov-report=xml --cov-report=term-missing -v | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| cache: 'pip' | |
| cache-dependency-path: '**/requirements.test.txt' | |
| - name: Install linting dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.test.txt | |
| pip install ruff mypy | |
| - name: Run ruff (lint) | |
| run: ruff check custom_components/ | |
| - name: Run ruff (format check) | |
| run: ruff format --check custom_components/ | |
| - name: Run mypy (check) | |
| run: mypy custom_components/ --ignore-missing-imports --python-version 3.13 | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Validate with hassfest | |
| uses: home-assistant/actions/hassfest@master | |
| with: | |
| path: './custom_components' | |
| - name: Validate with HACS | |
| uses: hacs/action@main | |
| with: | |
| category: integration |