Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml → .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: CI
name: Python CI

on:
push:
branches: [main, release-standards]
paths: ['python/**', '.github/workflows/python-ci.yml']
pull_request:
branches: [main]
paths: ['python/**']
workflow_dispatch: # Allow manual triggering for benchmark jobs

jobs:
Expand All @@ -23,10 +25,10 @@ jobs:
run: pip install ruff

- name: Run ruff check
run: ruff check src/ scripts/ tests/
run: ruff check python/src/ python/scripts/ python/tests/

- name: Run ruff format check
run: ruff format --check src/ scripts/ tests/
run: ruff format --check python/src/ python/scripts/ python/tests/

test:
name: Test
Expand All @@ -43,14 +45,14 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r python/requirements.txt

- name: Verify MLX installation
run: |
Expand All @@ -60,9 +62,9 @@ jobs:
run: |
# NOTE: Running CI-safe tests only to conserve Apple Silicon runner costs
# This gives PARTIAL coverage. For full coverage, run locally:
# pytest -m unit --cov=src --cov-report=html
# cd python && pytest -m unit --cov=src --cov-report=html
# Skip: requires_mlx, requires_model, requires_training, performance
pytest -m "unit and not requires_mlx and not requires_model and not requires_training and not performance" \
cd python && pytest -m "unit and not requires_mlx and not requires_model and not requires_training and not performance" \
--cov=src --cov-report=xml --cov-report=term-missing \
-v

Expand All @@ -85,7 +87,7 @@ jobs:
import xml.etree.ElementTree as ET
import sys

tree = ET.parse('coverage.xml')
tree = ET.parse('python/coverage.xml')
root = tree.getroot()

# Module-specific coverage requirements for CI-safe tests (partial coverage)
Expand Down Expand Up @@ -136,7 +138,7 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: arosboro/your_ai
files: ./coverage.xml
files: ./python/coverage.xml
flags: ci-safe # Mark as partial coverage from CI-safe tests
fail_ci_if_error: false
verbose: true
Expand All @@ -159,20 +161,20 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r python/requirements.txt

- name: Run lightweight hypothesis verification tests
run: |
# Run only ci_safe mathematical verification tests (no MLX required)
# Note: test_30x_multiplier_documented_example requires MLX, so we skip it
pytest tests/unit/test_algorithm_hypotheses.py::TestThirtyXMultiplierHypothesis::test_30x_multiplier_formula_breakdown \
cd python && pytest tests/unit/test_algorithm_hypotheses.py::TestThirtyXMultiplierHypothesis::test_30x_multiplier_formula_breakdown \
-v --tb=short

integration:
Expand All @@ -191,19 +193,19 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r python/requirements.txt

- name: Run integration tests (lightweight only)
run: |
# Skip model loading and training tests on CI
pytest -m "integration and not requires_model and not requires_training" -v --maxfail=3
cd python && pytest -m "integration and not requires_model and not requires_training" -v --maxfail=3

# External Benchmark Evaluation (Manual Trigger Only)
benchmark-evaluation:
Expand All @@ -222,20 +224,20 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('python/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r python/requirements.txt
pip install datasets # Required for TruthfulQA

- name: Run TruthfulQA Benchmark
run: |
echo "Running TruthfulQA benchmark..."
python scripts/run_benchmarks.py \
cd python && python scripts/run_benchmarks.py \
--model "NousResearch/Hermes-2-Pro-Mistral-7B" \
--benchmarks truthfulqa \
--max-samples 50 \
Expand All @@ -245,7 +247,7 @@ jobs:
- name: Run Custom Tests with Benchmarks
run: |
echo "Running custom tests with benchmark integration..."
python scripts/validate_model.py \
cd python && python scripts/validate_model.py \
--model "NousResearch/Hermes-2-Pro-Mistral-7B" \
--benchmarks truthfulqa \
--output results/validation_with_benchmarks.json
Expand All @@ -256,7 +258,7 @@ jobs:
if: always()
with:
name: benchmark-results
path: results/*benchmark*.json
path: python/results/*benchmark*.json
retention-days: 30

- name: Comment Benchmark Summary
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Rust CI

on:
push:
branches: [main]
paths: ['rust/**', '.github/workflows/rust-ci.yml']
pull_request:
branches: [main]
paths: ['rust/**', '.github/workflows/rust-ci.yml']

jobs:
lint:
name: Lint
runs-on: macos-14 # Apple Silicon for MLX support
env:
MACOSX_DEPLOYMENT_TARGET: "13.5"
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: rust/target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Check formatting
run: cargo fmt --manifest-path rust/Cargo.toml --all -- --check

- name: Run clippy
run: cargo clippy --manifest-path rust/Cargo.toml --all-targets --all-features -- -D warnings

build-and-test:
name: Build and Test
runs-on: macos-14 # Apple Silicon for MLX support
env:
MACOSX_DEPLOYMENT_TARGET: "13.5"
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: rust/target
key: ${{ runner.os }}-cargo-build-test-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-test-

- name: Build
run: cargo build --release --manifest-path rust/Cargo.toml

- name: Run tests
run: cargo test --manifest-path rust/Cargo.toml --all-features

- name: Run doc tests
run: cargo test --manifest-path rust/Cargo.toml --doc

examples:
name: Build Examples
runs-on: macos-14 # Apple Silicon for MLX support
env:
MACOSX_DEPLOYMENT_TARGET: "13.5"
needs: [lint, build-and-test]
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-git-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: rust/target
key: ${{ runner.os }}-cargo-build-examples-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-examples-

- name: Build examples
run: cargo build --manifest-path rust/Cargo.toml --examples --release

Loading
Loading