Skip to content

Migrate to Ray Serve and capability-based inference API (#45) #100

Migrate to Ray Serve and capability-based inference API (#45)

Migrate to Ray Serve and capability-based inference API (#45) #100

# =================================
# Copyright: CEA-LIST/DIASI/SIALV
# Author : pixano@cea.fr
# License: CECILL-C
# =================================
name: Lint and format back
on:
push:
paths:
- "src/**"
- "tests/**"
- ".github/workflows/lint_and_format.yml"
- "pyproject.toml"
- ".pre-commit-config.yaml"
branches:
- "main"
pull_request:
paths:
- "src/**"
- "tests/**"
- ".github/workflows/lint_and_format.yml"
- "pyproject.toml"
- ".pre-commit-config.yaml"
branches:
- "main"
permissions:
contents: read
jobs:
pre-commit:
name: Run pre-commit hooks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
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"
# Install PyTorch and TensorFlow CPU versions manually to prevent installing CUDA
# Install SAM and MobileSAM manually as they cannot be included in PyPI
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
- name: Format top-level Markdown and YAML files with Prettier
uses: creyD/prettier_action@v4.3
with:
dry: True
prettier_options: --check ./*.{md,yml}
# Prettier 3.0 not yet available in VSCode extension
prettier_version: 2.8.8
- name: Format GitHub actions YAML files with Prettier
uses: creyD/prettier_action@v4.3
with:
dry: True
prettier_options: --check ./.github/workflows/*.yml
# Prettier 3.0 not yet available in VSCode extension
prettier_version: 2.8.8
- name: Format docs Markdown files with Prettier
uses: creyD/prettier_action@v4.3
with:
dry: True
prettier_options: --check ./docs/**/*.md
# Prettier 3.0 not yet available in VSCode extension
prettier_version: 2.8.8