Skip to content

Add anchor_points_to_instance_mask_stack utility for converting ancho… #16

Add anchor_points_to_instance_mask_stack utility for converting ancho…

Add anchor_points_to_instance_mask_stack utility for converting ancho… #16

Workflow file for this run

# =============================================================================
# SynthMT CI Pipeline
# =============================================================================
# Runs tests via pytest after each commit and pull request
# =============================================================================
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch: # Allow manual trigger
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout repository
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 pytest pytest-cov
pip install -e .[models]
# Install transformers pre-release for SAM3 support
pip install -U transformers --pre
- name: Verify installation
run: |
python -c "import synth_mt; print('synth_mt imported successfully')"
pip list | grep synth
- name: Run tests with pytest
run: |
# Run tests, ignoring tests that require optional dependencies
# --ignore patterns for tests requiring specific optional deps
pytest tests/ -v --tb=short \
--ignore=tests/models/ \
--ignore=tests/model_hpo/ \
-x
test-full:
# Full test suite - runs on main branch only or manually
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Install all dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -e .[models,dev]
pip install -U transformers --pre
# Optional: Install tensorflow for stardist tests
# pip install tensorflow
- name: Run full test suite
run: |
pytest tests/ -v --tb=short || true
continue-on-error: true
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install ruff black
- name: Run ruff linter
run: |
ruff check synth_mt/ --output-format=github
continue-on-error: true
- name: Check formatting with black
run: |
black --check --diff synth_mt/
continue-on-error: true