name: Integration Testing on: push: branches: [ main, develop ] pull_request: branches: [ main ] jobs: test-integration: name: Integration Tests runs-on: ubuntu-latest strategy: matrix: python-version: ["3.13"] home-assistant-version: ["2025.9.4"] steps: - name: Checkout Code uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Cache pip dependencies uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }} restore-keys: | ${{ runner.os }}-pip-${{ matrix.python-version }}- - name: Install Dependencies run: | python -m pip install --upgrade pip pip install homeassistant==${{ matrix.home-assistant-version }} pip install -r requirements-dev.txt - name: Ensure Package Structure run: | mkdir -p custom_components touch custom_components/__init__.py - name: Run Unit Tests run: | python -m pytest tests/ -v --tb=short --cov=custom_components/adguard_hub --cov-report=xml --cov-report=term-missing --asyncio-mode=auto - name: Test Installation run: | python -c " import sys sys.path.insert(0, 'custom_components') try: from adguard_hub import DOMAIN print(f'✅ Integration can be imported, domain: {DOMAIN}') except Exception as e: print(f'❌ Import failed: {e}') sys.exit(1) " - name: Test Manifest Validation run: | python -c " import json import sys try: with open('custom_components/adguard_hub/manifest.json', 'r') as f: manifest = json.load(f) required_keys = ['domain', 'name', 'version', 'documentation', 'requirements'] missing = [k for k in required_keys if k not in manifest] if missing: print(f'❌ Missing manifest keys: {missing}') sys.exit(1) print('✅ Manifest is valid') except Exception as e: print(f'❌ Manifest validation failed: {e}') sys.exit(1) " - name: Upload Coverage Reports uses: actions/upload-artifact@v4 if: matrix.python-version == '3.13' && matrix.home-assistant-version == '2025.9.4' with: name: coverage-report path: coverage.xml