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