Modernization #46
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: API Lint | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'api/**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| paths: | |
| - 'api/**' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| black: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the code | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ vars.PYTHON_VERSION }} | |
| # Install uv | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "api/uv.lock" | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| cd api | |
| uv sync --all-extras | |
| # Run Black formatter | |
| - name: Run Black | |
| run: | | |
| cd api | |
| uv run black --check --diff . | |
| ty: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the code | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ vars.PYTHON_VERSION }} | |
| # Install uv | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "api/uv.lock" | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| cd api | |
| uv sync --all-extras | |
| # Run ty checks | |
| - name: Run ty | |
| run: | | |
| cd api | |
| uv run ty check | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the code | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ vars.PYTHON_VERSION }} | |
| # Install uv | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "api/uv.lock" | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| cd api | |
| uv sync --all-extras | |
| # Run Ruff linter and formatter | |
| - name: Run Ruff | |
| run: | | |
| cd api | |
| uv run ruff check . |