Skip to content

Fix Home layout + System tab rounding #24

Fix Home layout + System tab rounding

Fix Home layout + System tab rounding #24

Workflow file for this run

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