refactor: another refactor
Some checks failed
Integration Testing / Integration Tests (2024.12.0, 3.11) (push) Failing after 27s
Integration Testing / Integration Tests (2024.12.0, 3.12) (push) Failing after 56s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m38s
Integration Testing / Integration Tests (2025.9.4, 3.11) (push) Failing after 19s
Integration Testing / Integration Tests (2025.9.4, 3.12) (push) Failing after 20s
Integration Testing / Integration Tests (2025.9.4, 3.13) (push) Failing after 25s
Code Quality Check / Code Quality Analysis (push) Failing after 20s
Code Quality Check / Security Analysis (push) Failing after 21s
Some checks failed
Integration Testing / Integration Tests (2024.12.0, 3.11) (push) Failing after 27s
Integration Testing / Integration Tests (2024.12.0, 3.12) (push) Failing after 56s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m38s
Integration Testing / Integration Tests (2025.9.4, 3.11) (push) Failing after 19s
Integration Testing / Integration Tests (2025.9.4, 3.12) (push) Failing after 20s
Integration Testing / Integration Tests (2025.9.4, 3.13) (push) Failing after 25s
Code Quality Check / Code Quality Analysis (push) Failing after 20s
Code Quality Check / Security Analysis (push) Failing after 21s
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
@@ -2,55 +2,86 @@ name: Integration Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test-integration:
|
||||
name: Test Integration
|
||||
name: Integration Tests
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.13"]
|
||||
home-assistant-version: ["2025.9.4"]
|
||||
python-version: ["3.11", "3.12", "3.13"]
|
||||
home-assistant-version: ["2024.12.0", "2025.9.4"]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache pip dependencies
|
||||
id: pip-cache-dir
|
||||
run: echo "dir=$(pip cache dir)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pip-cache-dir.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install Python dependencies
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install homeassistant==${{ matrix.home-assistant-version }}
|
||||
pip install -r requirements-dev.txt
|
||||
|
||||
- name: Ensure package structure
|
||||
- name: Ensure Package Structure
|
||||
run: |
|
||||
mkdir -p custom_components
|
||||
touch custom_components/__init__.py
|
||||
|
||||
- name: Run tests
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
python -m pytest tests/ -v --cov=custom_components/adguard_hub --cov-report=term-missing --asyncio-mode=auto
|
||||
python -m pytest tests/ -v --tb=short --cov=custom_components/adguard_hub --cov-report=xml --cov-report=term-missing --asyncio-mode=auto
|
||||
|
||||
- name: Upload coverage
|
||||
if: always()
|
||||
run: echo "Tests completed"
|
||||
- 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
|
||||
|
Reference in New Issue
Block a user