Fix Home layout + System tab rounding #24
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: [develop, main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-asyncio pytest-cov freezegun homeassistant | |
| - name: Set up importable package structure | |
| run: | | |
| # Create custom_components structure outside the checkout | |
| # so pytest doesn't try to collect __init__.py from repo root | |
| mkdir -p /tmp/ha-config/custom_components | |
| cp -r $GITHUB_WORKSPACE /tmp/ha-config/custom_components/solar_energy_management | |
| - name: Run tests with coverage | |
| working-directory: /tmp/ha-config/custom_components/solar_energy_management | |
| env: | |
| PYTHONPATH: /tmp/ha-config | |
| run: | | |
| python -m pytest tests/ \ | |
| --cov=custom_components.solar_energy_management \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml:$GITHUB_WORKSPACE/coverage.xml \ | |
| -v --tb=short | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-py${{ matrix.python-version }} | |
| path: coverage.xml | |
| - name: Coverage summary | |
| if: always() | |
| working-directory: /tmp/ha-config/custom_components/solar_energy_management | |
| env: | |
| PYTHONPATH: /tmp/ha-config | |
| run: | | |
| python -m pytest tests/ \ | |
| --cov=custom_components.solar_energy_management \ | |
| --cov-report=term \ | |
| -q --no-header 2>&1 | tail -30 || true |