From 447b8564e9ad5f319fe0bd52f7b2c76351532dfb Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 5 Jun 2025 22:02:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20GitHub=20Actions=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pylint.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index bedec74b..5f8df1a1 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -24,12 +24,13 @@ jobs: uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' + cache: 'pip' - name: Cache pip dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements.in') }} @@ -38,13 +39,17 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools wheel pip install pylint # 安装项目依赖 if [ -f requirements.txt ]; then + echo "📦 安装 requirements.txt 中的依赖..." pip install -r requirements.txt elif [ -f requirements.in ]; then + echo "📦 安装 requirements.in 中的依赖..." pip install -r requirements.in + else + echo "⚠️ 未找到依赖文件,仅安装 pylint" fi - name: Verify pylint config @@ -83,7 +88,7 @@ jobs: pylint app/ --score=yes --reports=no | tail -2 || true - name: Upload pylint report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: pylint-report