Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ CAPTCHA_CHECK_INTERVAL=30
# Maximum time to wait for CAPTCHA resolution before aborting (in minutes)
CAPTCHA_TIMEOUT_MINUTES=30

# Wait time after page refresh when checking CAPTCHA status (in seconds)
CAPTCHA_PAGE_LOAD_WAIT=2

# ============================================================================
# SHUTDOWN HANDLING
# ============================================================================
# How often to check for shutdown signal during retry delays (in seconds)
SHUTDOWN_CHECK_INTERVAL=1

# ============================================================================
# NOTIFICATION LOGIC
# ============================================================================
Expand Down
29 changes: 29 additions & 0 deletions .github/scripts/parse_test_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""Parse pytest JUnit XML results for GitHub Actions summary."""

import xml.etree.ElementTree as ET
import sys

def main():
try:
tree = ET.parse('pytest-results.xml')
root = tree.getroot()

tests = root.attrib.get('tests', '0')
skipped = root.attrib.get('skipped', '0')
failures = root.attrib.get('failures', '0')
errors = root.attrib.get('errors', '0')
time = float(root.attrib.get('time', '0'))

print("| Tests | Skipped | Failures | Errors | Time |")
print("|-------|---------|----------|--------|------|")
print(f"| {tests} | {skipped} 🦘 | {failures} ❌ | {errors} 🔥 | {time:.2f}s ⏱️ |")
print()

except FileNotFoundError:
print("⚠️ Test results file not found")
except Exception as e:
print(f"⚠️ Could not parse test results: {e}")

if __name__ == '__main__':
main()
55 changes: 55 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Code Quality

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:

permissions:
contents: read

jobs:
Linting:
name: Linting & Type Checking
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pylint mypy ruff
pip install -r requirements.txt

- name: Run ruff (fast linter)
continue-on-error: true
run: |
ruff check app/ --output-format=github

- name: Run flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics \
--exclude=.git,__pycache__,venv,env,.venv,.mypy_cache,.pytest_cache,build,dist

- name: Run pylint
continue-on-error: true
run: |
pylint app/ --exit-zero --output-format=colorized --score=yes

- name: Run mypy
continue-on-error: true
run: |
mypy app/ --ignore-missing-imports --no-strict-optional --pretty
142 changes: 0 additions & 142 deletions .github/workflows/python-app.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Security

on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Run weekly on Sundays

permissions:
contents: read

jobs:
Security:
name: Security Scan
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install safety bandit

- name: Check for security vulnerabilities in dependencies
continue-on-error: true
run: |
safety check --json || true

- name: Run bandit security scan
continue-on-error: true
run: |
bandit -r app/ -f json -o bandit-report.json || true
bandit -r app/ -f screen

- name: Upload security reports
uses: actions/upload-artifact@v4
if: always()
with:
name: security-reports
path: |
bandit-report.json
retention-days: 30
Loading
Loading