ci: add backend linting workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint Backend | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - "backend/**" | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - "backend/**" | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.9.18" | |
| - name: Cache uv dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('backend/uv.lock') }} | |
| restore-keys: uv-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run ruff check | |
| run: uv run ruff check --output-format=github . | |
| - name: Run ruff format check | |
| run: uv run ruff format --check --diff . |