From fb3e5f97bed6b78eba9fbfd9e89556c58941e0ee Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Tue, 8 Sep 2026 02:48:38 +0800 Subject: [PATCH] ci(actions): upgrade actions and adopt prek MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 🔧 CI/CD - Upgrade Python, Node.js, cache, and GitHub Pages actions to current major versions. - Replace pre-commit/action with j178/prek-action v3.0.0 using its default all-files checks. - Limit CI push and pull request branch filters to main. ## Validation - Pass pre-commit run --all-files --show-diff-on-failure. - Pass prek run --all-files in an isolated repository snapshot. - Validate workflow YAML and git diff --check. --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/deploy-docs.yml | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 637ed744..6dce3a4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [main, develop] + branches: [main] pull_request: - branches: [main, develop] + branches: [main] workflow_dispatch: concurrency: @@ -21,12 +21,12 @@ jobs: uses: actions/checkout@v7 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: "3.10" - - name: Run pre-commit - uses: pre-commit/action@v3.0.1 + - name: Run prek + uses: j178/prek-action@v3.0.0 # ── Unit tests (matrix: Python 3.10 / 3.11 / 3.12) ──────────────────────── test: @@ -41,12 +41,12 @@ jobs: uses: actions/checkout@v7 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Cache pip - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index c8c99d17..3fbd50e6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -30,12 +30,12 @@ jobs: fetch-depth: 0 - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: node-version: 20 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: '3.11' @@ -48,13 +48,13 @@ jobs: npm install --no-audit --no-fund --no-save @rollup/rollup-linux-x64-gnu - name: Setup Pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@v6 - name: Build VitePress site run: npm run docs:build - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: docs/.vitepress/dist @@ -68,4 +68,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5