From 2efec9d3924ce1d806b04e2d51c1cda285bf501d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 12 Aug 2026 17:11:34 +0800 Subject: ci: Refactor CI workflows into single check matrix Replace the separate code/docs CI jobs and local check flags with a unified `--check-*` flag system, enabling each check to run independently across a platform matrix. --- .github/workflows/ci-check-only.yml | 37 +---- .github/workflows/ci.yml | 39 +----- .idea/runConfigurations/Check__Codes.xml | 2 +- .idea/runConfigurations/Check__Documents.xml | 2 +- .run/src/bin/ci.rs | 201 ++++++++++++++++++++------- .run/src/bin/cov-test.rs | 21 +-- .run/src/bin/docsify-sidebar-gen.rs | 14 +- .run/src/bin/refresh-feature-mod.rs | 2 +- docs/dev/pages/abouts/ci.md | 51 ++++--- 9 files changed, 217 insertions(+), 152 deletions(-) diff --git a/.github/workflows/ci-check-only.yml b/.github/workflows/ci-check-only.yml index 2cff3a6..fab7e99 100644 --- a/.github/workflows/ci-check-only.yml +++ b/.github/workflows/ci-check-only.yml @@ -6,48 +6,21 @@ on: pull_request: jobs: - Check-Codes: + Check: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] + item: [build, clippy, test, arg-picker, markdown-code, examples, docs-refresh, api-docs] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Restore .temp cache - id: cache-temp - uses: actions/cache@v4 - with: - path: .temp - key: ${{ runner.os }}-mingling-temp-codes-${{ hashFiles('.run/Cargo.toml', '.run/src/**/*.rs', 'Cargo.lock', 'verified-docs.toml', 'examples/test-examples.toml') }} - restore-keys: | - ${{ runner.os }}-mingling-temp-codes- - - - run: cargo ci --test-codes - - Check-Docs: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Restore .temp cache - id: cache-temp - uses: actions/cache@v4 - with: - path: .temp - key: ${{ runner.os }}-mingling-temp-docs-${{ hashFiles('.run/Cargo.toml', '.run/src/**/*.rs', 'Cargo.lock', 'verified-docs.toml', 'examples/test-examples.toml') }} - restore-keys: | - ${{ runner.os }}-mingling-temp-docs- - - - run: cargo ci --test-docs + - run: cargo ci --check-${{ matrix.item }} - name: Upload docs test result on failure - if: failure() + if: failure() && matrix.item == 'markdown-code' uses: actions/upload-artifact@v4 with: name: docs-test-result-${{ matrix.os }}.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8b133f..8210703 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,48 +8,21 @@ permissions: contents: write jobs: - Check-Codes: + Check: strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] + item: [build, clippy, test, arg-picker, markdown-code, examples, docs-refresh, api-docs] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Restore .temp cache - id: cache-temp - uses: actions/cache@v4 - with: - path: .temp - key: ${{ runner.os }}-mingling-temp-codes-${{ hashFiles('.run/Cargo.toml', '.run/src/**/*.rs', 'Cargo.lock', 'verified-docs.toml', 'examples/test-examples.toml') }} - restore-keys: | - ${{ runner.os }}-mingling-temp-codes- - - - run: cargo ci --test-codes - - Check-Docs: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Restore .temp cache - id: cache-temp - uses: actions/cache@v4 - with: - path: .temp - key: ${{ runner.os }}-mingling-temp-docs-${{ hashFiles('.run/Cargo.toml', '.run/src/**/*.rs', 'Cargo.lock', 'verified-docs.toml', 'examples/test-examples.toml') }} - restore-keys: | - ${{ runner.os }}-mingling-temp-docs- - - - run: cargo ci --test-docs + - run: cargo ci --check-${{ matrix.item }} - name: Upload docs test result on failure - if: failure() + if: failure() && matrix.item == 'markdown-code' uses: actions/upload-artifact@v4 with: name: docs-test-result-${{ matrix.os }}.md @@ -57,7 +30,7 @@ jobs: Move-Unreleased-Tag: if: github.ref == 'refs/heads/main' - needs: [Check-Codes, Check-Docs] + needs: [Check] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.idea/runConfigurations/Check__Codes.xml b/.idea/runConfigurations/Check__Codes.xml index f117f8f..75f5e09 100644 --- a/.idea/runConfigurations/Check__Codes.xml +++ b/.idea/runConfigurations/Check__Codes.xml @@ -8,7 +8,7 @@ >