Skip to content

Feature Architecture & CI Improvements #23

Feature Architecture & CI Improvements

Feature Architecture & CI Improvements #23

Workflow file for this run

name: CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check file endings
run: |
if [ "$(file generate-values-prd.py | grep -o 'CRLF')" = "CRLF" ]; then
echo "Error: File has CRLF line endings"
exit 1
fi
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Validate module imports
run: |
echo "Validating Python module imports..."
python -c "
import sys
modules = [
'config',
'generator',
'version_manager',
'i18n',
'i18n.language',
'i18n.translations',
'utils',
'utils.colors',
'utils.downloader',
'utils.prompts',
'utils.secrets',
'modules',
'modules.global_config',
'modules.infrastructure',
'modules.mail',
'modules.networking',
'modules.plugins',
'modules.services',
'modules.features',
'modules.features.base',
'modules.features.external_prometheus',
'modules.features.plugin_metric',
'modules.features.trigger_worker',
]
failed = []
for module in modules:
try:
__import__(module)
print(f'✓ {module}')
except Exception as e:
print(f'✗ {module}: {e}')
failed.append(module)
if failed:
print(f'\n❌ Failed to import {len(failed)} module(s)')
sys.exit(1)
else:
print(f'\n✅ All {len(modules)} modules imported successfully')
"
- name: Run feature tests
run: |
echo "Running feature tests..."
python test_features.py
# Note: test_services.py and test_s3_config.py require values.yaml
# They are not included in CI until integration tests are implemented
# See docs/CI-INTEGRATION-PLAN.md for the full plan
shell-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Run shellcheck
run: |
echo "Checking shell scripts..."
shellcheck generate-image-repo-secret.sh || echo "::warning::shellcheck found issues"