Skip to content

feat: Add Windows 11 production config with absolute paths and FFmpeg… #44

feat: Add Windows 11 production config with absolute paths and FFmpeg…

feat: Add Windows 11 production config with absolute paths and FFmpeg… #44

Workflow file for this run

name: CI - Semantic Foragecast Engine
on:
push:
branches: [ main, develop, claude/* ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Allow manual triggering
jobs:
# Phase 1: Unit Tests
unit-tests:
name: Unit Tests - Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov pytest-xdist
- name: Run Phase 1 unit tests
run: |
pytest tests/test_prep_audio.py -v --cov=prep_audio --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
# Phase 2: E2E Tests
e2e-tests:
name: E2E Tests - Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: unit-tests
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: Run E2E test suite
run: |
python tests/test_e2e_pipeline.py
- name: Upload E2E test results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results-py${{ matrix.python-version }}
path: |
tests/
!tests/__pycache__/
# Phase 3: Blender Integration Smoke Tests
blender-smoke-tests:
name: Blender Smoke Tests
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Blender
run: |
sudo apt-get update
sudo apt-get install -y wget xz-utils
# Download Blender 4.0 LTS
BLENDER_VERSION="4.0.2"
BLENDER_URL="https://download.blender.org/release/Blender4.0/blender-${BLENDER_VERSION}-linux-x64.tar.xz"
wget -q $BLENDER_URL -O blender.tar.xz
tar -xf blender.tar.xz
# Add to PATH
echo "$(pwd)/blender-${BLENDER_VERSION}-linux-x64" >> $GITHUB_PATH
- name: Verify Blender installation
run: |
blender-4.0.2-linux-x64/blender --version
- name: Test Blender script syntax
run: |
# Just check if the script can be parsed by Blender
blender-4.0.2-linux-x64/blender --background --python-expr "import bpy; print('Blender Python OK')"
- name: Validate Blender scripts
run: |
# Check if scripts are valid Python
python -m py_compile blender_script.py
python -m py_compile grease_pencil.py
echo "✓ Blender scripts validated"
# Phase 4: Video Export Tests
video-export-tests:
name: Video Export Tests
runs-on: ubuntu-latest
needs: unit-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: Install FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
ffmpeg -version
- name: Run video export tests
run: |
pytest tests/test_export_video.py -v
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: video-export-artifacts
path: outputs/
# Phase 5: Linting and Code Quality
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install flake8 pylint black isort mypy
- name: Run flake8
continue-on-error: true
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=15 --max-line-length=120 --statistics
- name: Check code formatting with black
continue-on-error: true
run: |
black --check --line-length=100 *.py
- name: Check import sorting with isort
continue-on-error: true
run: |
isort --check-only --profile=black *.py
# Phase 6: Security Scanning
security-scan:
name: Security Vulnerability Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
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: Run safety check
continue-on-error: true
run: |
pip install safety
safety check --json || true
- name: Run bandit security scan
continue-on-error: true
run: |
pip install bandit
bandit -r . -f json -o bandit-report.json || true
- name: Upload security reports
if: always()
uses: actions/upload-artifact@v4
with:
name: security-reports
path: |
bandit-report.json
# Summary job
ci-summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [unit-tests, e2e-tests, blender-smoke-tests, video-export-tests, code-quality, security-scan]
if: always()
steps:
- name: Check job statuses
run: |
echo "==================================================="
echo "CI Pipeline Summary - Semantic Foragecast Engine"
echo "==================================================="
echo ""
echo "Unit Tests: ${{ needs.unit-tests.result }}"
echo "E2E Tests: ${{ needs.e2e-tests.result }}"
echo "Blender Smoke Tests: ${{ needs.blender-smoke-tests.result }}"
echo "Video Export Tests: ${{ needs.video-export-tests.result }}"
echo "Code Quality: ${{ needs.code-quality.result }}"
echo "Security Scan: ${{ needs.security-scan.result }}"
echo ""
echo "==================================================="
# Fail if critical jobs failed
if [ "${{ needs.unit-tests.result }}" != "success" ]; then
echo "❌ Unit tests failed"
exit 1
fi
if [ "${{ needs.e2e-tests.result }}" != "success" ]; then
echo "❌ E2E tests failed"
exit 1
fi
echo "✅ All critical tests passed!"