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 ++++++------------------------------- 2 files changed, 11 insertions(+), 65 deletions(-) (limited to '.github/workflows') 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 -- cgit