Skip to content

feat: enhance image size handling across the codebase #366

feat: enhance image size handling across the codebase

feat: enhance image size handling across the codebase #366

Workflow file for this run

name: Run Focoos tests
on:
pull_request:
workflow_dispatch:
env:
UV_SYSTEM_PYTHON: 1
jobs:
code-tests:
permissions:
id-token: write # This is required for requesting the JWT
contents: read
issues: write
pull-requests: write
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11","3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: 🐍 Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: ${{ matrix.python-version }}
- name: 📦 Install dev dependencies
run: uv sync --extra dev --extra onnx-cpu
- name: 🧪 Run test
run: make test
- name: 📊 Generate test coverage report
if: ${{ github.ref_name != 'main' }}
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./tests/coverage.xml
junitxml-path: ./tests/junit.xml
report-only-changed-files: true
hide-report: true
model-tests:
runs-on: actions-runner-cuda12
steps:
- name: 📥 Checkout Repository
uses: actions/checkout@v4
- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: 🐍 Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: 📦 Install dev dependencies
run: uv sync --extra dev --extra onnx
- name: 🧪 Run e2e tests for all models
run: |
echo "🔍 Discovering models in model registry..."
MODELS=$(find ./focoos/model_registry -maxdepth 1 -type f -name "*.json" | xargs -n1 basename | sed 's/\.json$//')
if [ -z "$MODELS" ]; then
echo "⚠️ No models found in registry"
exit 1
fi
echo "📋 Found models: $(echo "$MODELS" | tr '\n' ' ')"
for model in $MODELS; do
echo "🧪 Testing model: $model"
uv run ops/test_training.py --model "$model"
done
echo "✅ All model tests completed successfully"
- name: 🧹 Minimize uv cache
run: uv cache prune --ci