From dfd7fadb85f0f8a16e067433453f2793eacb854f Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Thu, 20 Mar 2025 18:09:22 +0800 Subject: [PATCH] update --- .github/workflows/api-tests-on-uv.yml | 5 ++- .github/workflows/style.yml | 48 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/api-tests-on-uv.yml b/.github/workflows/api-tests-on-uv.yml index b61ad12944..994834adf1 100644 --- a/.github/workflows/api-tests-on-uv.yml +++ b/.github/workflows/api-tests-on-uv.yml @@ -43,9 +43,8 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Check Poetry lockfile - run: | - uv lock --project api --check + - name: Check UV lockfile + run: uv lock --project api --check - name: Install dependencies run: uv sync --project api --all-groups diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index d73a782c93..a9e5617026 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -52,6 +52,54 @@ jobs: if: failure() run: echo "Please run 'dev/reformat' to fix the fixable linting errors." + python-style-on-uv: + name: Python Style on UV + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Check changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + api/** + .github/workflows/style.yml + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: "Set up Python" + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + if: steps.changed-files.outputs.any_changed == 'true' + run: uv sync --project api --only-group lint + + - name: Ruff check + if: steps.changed-files.outputs.any_changed == 'true' + run: | + uv run --project apiruff --version + uv run --project apiruff check ./ + uv run --project apiruff format --check ./ + + - name: Dotenv check + if: steps.changed-files.outputs.any_changed == 'true' + run: uv run --project api dotenv-linter ./api/.env.example ./web/.env.example + + - name: Lint hints + if: failure() + run: echo "Please run 'dev/reformat' to fix the fixable linting errors." + web-style: name: Web Style runs-on: ubuntu-latest