Skip to content

feat(cycle-111): FULL SYSTEM AUDIT + COMPLETE DOCUMENTATION #5

feat(cycle-111): FULL SYSTEM AUDIT + COMPLETE DOCUMENTATION

feat(cycle-111): FULL SYSTEM AUDIT + COMPLETE DOCUMENTATION #5

# VIBEE BitNet Benchmark Tests CI
# φ² + 1/φ² = 3 | PHOENIX = 999
name: Benchmark Tests
on:
push:
branches: [main]
paths:
- 'trinity/output/fpga/driver/python/**'
- 'specs/tri/benchmark*.vibee'
- '.github/workflows/benchmark-tests.yml'
pull_request:
branches: [main]
paths:
- 'trinity/output/fpga/driver/python/**'
- 'specs/tri/benchmark*.vibee'
jobs:
# ═══════════════════════════════════════════════════════════════════════════
# Python Unit Tests
# ═══════════════════════════════════════════════════════════════════════════
test-python:
name: Python Tests (py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
defaults:
run:
working-directory: trinity/output/fpga/driver/python
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: trinity/output/fpga/driver/python/requirements-test.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
- name: Run syntax check
run: |
python -m py_compile bitnet/benchmark/*.py
python -m py_compile tests/*.py
echo "✅ Syntax check passed"
- name: Run tests
run: |
python -m pytest tests/ -v \
--tb=short \
--junitxml=test-results/junit.xml \
--cov=bitnet/benchmark \
--cov-report=xml:coverage.xml \
--cov-report=html:htmlcov \
--cov-report=term-missing
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-py${{ matrix.python-version }}
path: trinity/output/fpga/driver/python/test-results/
retention-days: 7
- name: Upload coverage
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.11'
with:
name: coverage-report
path: trinity/output/fpga/driver/python/htmlcov/
retention-days: 7
# ═══════════════════════════════════════════════════════════════════════════
# Lint Check
# ═══════════════════════════════════════════════════════════════════════════
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: trinity/output/fpga/driver/python
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install linters
run: pip install flake8
- name: Run flake8
run: |
flake8 bitnet/ tests/ \
--max-line-length=100 \
--ignore=E501,W503,E203 \
--exclude=__pycache__ \
|| echo "⚠️ Lint warnings found"
# ═══════════════════════════════════════════════════════════════════════════
# Validate Specs
# ═══════════════════════════════════════════════════════════════════════════
validate-specs:
name: Validate .vibee Specs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate benchmark specs
run: |
echo "Validating benchmark .vibee files..."
for file in specs/tri/benchmark*.vibee; do
if [ -f "$file" ]; then
python3 -c "import yaml; yaml.safe_load(open('$file'))" && \
echo "✅ $file" || echo "❌ $file"
fi
done
# ═══════════════════════════════════════════════════════════════════════════
# Summary
# ═══════════════════════════════════════════════════════════════════════════
summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test-python, lint, validate-specs]
if: always()
steps:
- name: Check results
run: |
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ VIBEE Benchmark Tests Summary ║"
echo "╠══════════════════════════════════════════════════════════════╣"
echo "║ Python Tests: ${{ needs.test-python.result }}"
echo "║ Lint: ${{ needs.lint.result }}"
echo "║ Specs: ${{ needs.validate-specs.result }}"
echo "╚══════════════════════════════════════════════════════════════╝"
if [ "${{ needs.test-python.result }}" != "success" ]; then
echo "❌ Python tests failed"
exit 1
fi
echo "✅ All checks passed"