From 9412b11e61dfcc06db5bc3e5d079bdee3fb8add2 Mon Sep 17 00:00:00 2001 From: Gaubee Date: Mon, 22 Dec 2025 20:08:01 +0800 Subject: [PATCH] ci: simplify checks - remove intermediate jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove checks-fast/checks-standard intermediate jobs. Now checks runs directly on self-hosted or ubuntu-latest based on USE_SELF_HOSTED variable. Flow: ci-fast/ci-standard → checks (直接聚合) --- .github/workflows/ci.yml | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4472dca1b..f8c1bb1e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,44 +110,16 @@ jobs: fi # ==================== 状态汇总 (分支保护需要) ==================== - # checks-fast 在 self-hosted 上快速汇总 - checks-fast: - if: vars.USE_SELF_HOSTED == 'true' - runs-on: self-hosted - needs: [ci-fast] - steps: - - name: Check results - run: | - if [[ "${{ needs.ci-fast.result }}" == "failure" ]]; then - echo "CI failed!" - exit 1 - fi - echo "All checks passed!" - - # checks-standard 在 GitHub-hosted 上汇总 - checks-standard: - if: vars.USE_SELF_HOSTED != 'true' - runs-on: ubuntu-latest - needs: [ci-standard] - steps: - - name: Check results - run: | - if [[ "${{ needs.ci-standard.result }}" == "failure" ]]; then - echo "CI failed!" - exit 1 - fi - echo "All checks passed!" - - # checks 是分支保护需要的 job,聚合 fast/standard 结果 + # checks 直接在对应 runner 上运行,无需中间层 checks: - runs-on: ubuntu-latest - needs: [checks-fast, checks-standard] + runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }} + needs: [ci-fast, ci-standard] if: always() steps: - name: Check results run: | - FAST="${{ needs.checks-fast.result }}" - STD="${{ needs.checks-standard.result }}" + FAST="${{ needs.ci-fast.result }}" + STD="${{ needs.ci-standard.result }}" if [[ "$FAST" == "failure" ]] || [[ "$STD" == "failure" ]]; then echo "CI failed!"