fix: Fix CI/CD issues and enhance integration
Some checks failed
Integration Testing / Integration Tests (2024.12.0, 3.11) (push) Failing after 22s
Integration Testing / Integration Tests (2024.12.0, 3.12) (push) Failing after 21s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m32s
Integration Testing / Integration Tests (2025.9.4, 3.11) (push) Failing after 15s
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 20s

Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
2025-09-28 17:24:46 +01:00
parent bcec7bbf1a
commit 8281a1813d
17 changed files with 1439 additions and 276 deletions

View File

@@ -12,8 +12,8 @@ jobs:
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 Code
@@ -24,14 +24,6 @@ jobs:
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
@@ -45,7 +37,7 @@ jobs:
- 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
python -m pytest tests/ -v --tb=short --cov=custom_components/adguard_hub --cov-report=xml --cov-report=term-missing --asyncio-mode=auto --cov-fail-under=60
- name: Test Installation
run: |
@@ -78,10 +70,3 @@ jobs:
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

View File

@@ -1,70 +0,0 @@
name: Code Quality Check
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
code-quality:
name: Code Quality Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Code Formatting Check (Black)
run: |
black --check custom_components/ tests/
- name: Import Sorting Check (isort)
run: |
isort --check-only --diff custom_components/ tests/
- name: Linting (flake8)
run: |
flake8 custom_components/ tests/
- name: Type Checking (mypy)
run: |
mypy custom_components/adguard_hub/ --ignore-missing-imports
continue-on-error: true
security-scan:
name: Security Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Security Tools
run: |
python -m pip install --upgrade pip
pip install bandit safety
- name: Security Check (Bandit)
run: |
bandit -r custom_components/ -ll
- name: Dependency Security Check (Safety)
run: |
pip install -r requirements.txt
safety check

View File

@@ -1,70 +0,0 @@
name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Tag Format
run: |
if [[ ! "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Invalid tag format. Expected: v1.2.3"
exit 1
fi
echo "✅ Valid semantic version tag: ${{ github.ref_name }}"
- name: Extract Version
id: version
run: |
VERSION=${{ github.ref_name }}
VERSION_NUMBER=${VERSION#v}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "version_number=${VERSION_NUMBER}" >> $GITHUB_OUTPUT
- name: Update Manifest Version
run: |
sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.version_number }}"/' custom_components/adguard_hub/manifest.json
- name: Run Tests Before Release
run: |
python -m pip install --upgrade pip
pip install homeassistant==2025.9.4
pip install -r requirements-dev.txt
mkdir -p custom_components
touch custom_components/__init__.py
python -m pytest tests/ -v --tb=short
- name: Create Release Archive
run: |
cd custom_components
zip -r ../adguard-control-hub-${{ steps.version.outputs.version_number }}.zip adguard_hub/
- name: Generate Changelog
id: changelog
run: |
PREVIOUS_TAG=$(git tag --sort=-version:refname | head -2 | tail -1 2>/dev/null || echo "")
if [ -z "$PREVIOUS_TAG" ]; then
echo "changelog=Initial release of AdGuard Control Hub" >> $GITHUB_OUTPUT
else
echo "changelog=Changes since $PREVIOUS_TAG" >> $GITHUB_OUTPUT
fi
- name: Success Message
run: |
echo "🎉 Release ${{ steps.version.outputs.version }} created!"
echo "📦 Archive: adguard-control-hub-${{ steps.version.outputs.version_number }}.zip"