Skip to content

Create a global client for OFF API #178

Create a global client for OFF API

Create a global client for OFF API #178

name: Backend pre-commit
on:
pull_request:
paths:
- 'backend/**'
push:
branches: [main]
paths:
- 'backend/**'
jobs:
pre-commit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install UV
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies with UV
run: uv sync --all-groups
# Cache pre-commit for faster runs
- name: Set PY
run: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
# Install linting tools
- name: Install linting tools
run: uv pip install ruff mypy
# Run specific linters from pre-commit config but exclude tests
- name: Run Ruff
run: uv run ruff check --fix --line-length=120 --select=E,F,I .
- name: Run Ruff Format
run: uv run ruff format --line-length=120 .
- name: Run Mypy
run: uv run mypy --exclude app/scripts .