From 471a9da03aa000aa64fef45ef3595f55db6f0629 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Sat, 8 Feb 2025 17:03:31 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=9B=B4=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linting.yml | 11 +++++++++++ .github/workflows/pyright.yml | 12 ++++++------ .github/workflows/ruff.yml | 3 ++- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/linting.yml diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..a60f796a --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,11 @@ +name: Sequential Lint and Type Check + +on: [push, pull_request] + +jobs: + ruff-call: + uses: ./.github/workflows/ruff.yml + + pyright-call: + needs: ruff-call + uses: ./.github/workflows/pyright.yml diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml index ac93614a..07de6509 100644 --- a/.github/workflows/pyright.yml +++ b/.github/workflows/pyright.yml @@ -1,6 +1,7 @@ name: Pyright Lint on: + workflow_call: # 允许此工作流作为可重用工作流被调用 push: branches: - "*" @@ -42,8 +43,8 @@ jobs: cancel-in-progress: true steps: - - uses: actions/checkout@v4 - + - name: Checkout + uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: @@ -66,7 +67,6 @@ jobs: run: poetry install - name: Run Pyright - shell: bash - run: | - extra_args="${{ github.event.inputs.debug-mode == 'true' && '--warnings --verbose --level verbose' || '--warnings --verbose' }}" - poetry run pyright . $extra_args + uses: jakebailey/pyright-action@v2 + with: + pylance-version: latest-release diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 214a3d23..8e4dfca8 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,6 +1,7 @@ name: Ruff Lint on: + workflow_call: # 允许此工作流作为可重用工作流被调用 push: branches: - "*" @@ -23,7 +24,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Install Ruff Format + - name: Install Ruff uses: astral-sh/ruff-action@v3 - name: Run Ruff Check run: ruff check