fix: Complete fixes: tests, workflows, coverage
Some checks failed
Code Quality Check / Code Formatting (push) Failing after 21s
Code Quality Check / Security Analysis (push) Failing after 20s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m32s
Integration Testing / Integration Tests (2025.9.4, 3.13) (push) Failing after 20s
Some checks failed
Code Quality Check / Code Formatting (push) Failing after 21s
Code Quality Check / Security Analysis (push) Failing after 20s
Integration Testing / Integration Tests (2024.12.0, 3.13) (push) Failing after 1m32s
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:
78
.gitea/workflows/code-quality.yml
Normal file
78
.gitea/workflows/code-quality.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Code Quality Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
code-formatting:
|
||||
name: Code Formatting
|
||||
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: Cache pip dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-formatting-${{ hashFiles('**/requirements-dev.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-formatting-
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install black isort flake8
|
||||
|
||||
- name: Code Formatting Check (Black)
|
||||
run: |
|
||||
echo "🔍 Checking code formatting with Black..."
|
||||
black --check --diff --color custom_components/ tests/
|
||||
|
||||
- name: Import Sorting Check (isort)
|
||||
run: |
|
||||
echo "📦 Checking import sorting with isort..."
|
||||
isort --check-only --diff --color custom_components/ tests/
|
||||
|
||||
- name: Linting (flake8)
|
||||
run: |
|
||||
echo "🔍 Linting code with flake8..."
|
||||
flake8 custom_components/ tests/ --statistics --show-source
|
||||
|
||||
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: |
|
||||
echo "🔒 Running security analysis with Bandit..."
|
||||
bandit -r custom_components/ -ll
|
||||
|
||||
- name: Dependency Security Check (Safety)
|
||||
run: |
|
||||
echo "🔒 Checking dependencies with Safety..."
|
||||
pip install -r requirements-dev.txt
|
||||
safety check
|
Reference in New Issue
Block a user