Migrate to uv. #56
Workflow file for this run
This file contains 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: Validate pushes to official nameless* branch(es) | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
- "feat/**" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
jobs: | |
python: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: Pin Python version for uv | |
run: | | |
uv python pin ${{ matrix.python-version }} | |
- name: Set up Python ${{ matrix.python-version }} | |
run: | | |
uv python install | |
- name: Install dependencies | |
run: | | |
uv sync --all-extras | |
- name: Create Prisma client | |
run: | | |
uvx prisma db push | |
- name: Fix the code with ruff | |
run: | | |
uvx ruff check --exit-zero . | |
uvx ruff format . | |
- name: Type checking with BasedPyright | |
run: | | |
uvx basedpyright | |
- name: Push the formatted code if needed. | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
if: ${{ matrix.python-version == '3.13' }} | |
with: | |
commit_message: "[ci skip] Automated code format commit." | |
- name: Minimize uv cache | |
run: | | |
uv cache prune --ci |