Skip to content

DAIOF CI/CD

DAIOF CI/CD #252

Workflow file for this run

name: DAIOF CI/CD
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# Principle of Least Privilege: only read access for CI checks
permissions:
contents: read
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Reduced to ubuntu-only to cut CI cost; framework is pure Python with no
# platform-specific code. Re-add macos-latest/windows-latest if native
# extensions are introduced.
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: 📥 Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov flake8
- name: 🔍 Lint with flake8 (critical errors only)
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: 🧬 Verify immutable genes
run: |
python -c "
from digital_ai_organism_framework import DigitalGenome
genome = DigitalGenome()
assert 'human_dependency_coefficient' in genome.traits
assert genome.traits['human_dependency_coefficient'] == 1.0
print('✅ Immutable genes verified')
"
- name: 🏛️ Verify doctrine compliance
run: |
python tests/test_doctrine_compliance.py
echo '✅ Doctrine compliance verified'
- name: 🧪 Run tests
run: |
pytest tests/ -v --cov=digital_ai_organism_framework --cov-report=xml --cov-report=term
- name: 📊 Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67ab1fd11d9025a # v4.7.2
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
validate:
name: Validate Framework
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.11'
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: 🎼 Test Symphony Control Center
run: |
python -c "
from digital_ai_organism_framework import SymphonyControlCenter
symphony = SymphonyControlCenter()
print('✅ Symphony Control Center functional')
"
- name: 🧬 Test Digital Organism lifecycle
run: |
python -c "
from digital_ai_organism_framework import DigitalOrganism
organism = DigitalOrganism()
for _ in range(10):
organism.metabolism.cycle({'cpu': 0.1, 'memory': 0.1})
assert organism.health > 0
print(f'✅ Organism lifecycle working (health: {organism.health:.2f})')
"
- name: 🌍 Test Ecosystem
run: |
python -c "
from digital_ai_organism_framework import DigitalEcosystem, DigitalOrganism
ecosystem = DigitalEcosystem()
for i in range(5):
ecosystem.add_organism(DigitalOrganism())
ecosystem.simulate_generation()
print(f'✅ Ecosystem functional with {len(ecosystem.organisms)} organisms')
"
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🐍 Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.11'
- name: 🔐 Run bandit security linter
run: |
pip install bandit
bandit -r digital_ai_organism_framework.py haios_core.py haios_runtime.py src/ -f json -o bandit-report.json || true
bandit -r digital_ai_organism_framework.py haios_core.py haios_runtime.py src/ -ll
continue-on-error: true
release:
name: Create Release
runs-on: ubuntu-latest
needs: [test, validate]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: 📥 Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🎉 Create Release
uses: softprops/action-gh-release@v2
with:
name: DAIOF ${{ github.ref_name }}
body: |
## Digital AI Organism Framework Release
See [CHANGELOG.md](CHANGELOG.md) for details.
**Status**: Production Ready ⚡
Creator: Alpha_Prime_Omega (4287)
Maintainer: Digital AI Organism
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}