From a9c477bffc5897af70628ab7fb122b78fadce42e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 30 Aug 2026 23:07:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E8=87=AA=E6=A3=80step=E7=A7=BB?= =?UTF-8?q?=E5=88=B0Checkout=E4=B9=8B=E5=90=8E=E2=80=94=E2=80=94=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DPR=E5=88=86=E6=94=AF=E6=97=A0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E8=AF=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-pipeline.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yml b/.gitea/workflows/ci-pipeline.yml index db154ef99..e50125e2e 100755 --- a/.gitea/workflows/ci-pipeline.yml +++ b/.gitea/workflows/ci-pipeline.yml @@ -58,9 +58,8 @@ jobs: echo "::warning::PR #${PR_NUMBER} 已合并,测试由合并后 push 流水线承接,PR 侧测试类 job 跳过" exit 0 fi - # 情形2:同一 head_sha 已有在跑/排队的 push 流水线(rebase/ff 合并竞态) - # 情形3(增强):同一 head_sha 的 push 流水线已成功完成(竞态窗口内两边都通过了dedup, - # 此刻 push 已跑完时PR侧测试纯属重复,2026-08-30 双跑实测CPU超卖14分→30分) + # 情形2:同一 head_sha 已有在跑/排队/已成功的 push 流水线(rebase/ff 合并竞态; + # 已成功也去重——竞态窗口内两边都通过判断时,PR侧再跑全量测试纯属重复) DUP=$(curl -sfH "Authorization: token $GITHUB_TOKEN" \ "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/actions/runs?head_sha=${HEAD_SHA}&per_page=30" \ | python3 -c "import json,sys; d=json.load(sys.stdin); runs=d if isinstance(d,list) else d.get('workflow_runs',d.get('runs',[])); hit=[r for r in runs if r.get('event')=='push' and (r.get('status') in ('in_progress','queued','waiting','pending') or r.get('conclusion')=='success')]; print('true' if hit else 'false')" || echo false) @@ -140,13 +139,13 @@ jobs: permissions: contents: write steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -246,13 +245,13 @@ jobs: permissions: contents: read steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -333,13 +332,13 @@ jobs: USE_IN_MEMORY_DB: 'false' CI_USE_SHARED_PG: 'true' steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -422,13 +421,13 @@ jobs: OSS_BUCKET_NAME: xiaoxia-autocut OSS_ENDPOINT: oss-cn-hangzhou.aliyuncs.com steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -508,13 +507,13 @@ jobs: OSS_BUCKET_NAME: xiaoxia-autocut OSS_ENDPOINT: oss-cn-hangzhou.aliyuncs.com steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -568,13 +567,13 @@ jobs: needs: [check-frontend-only, dedupe-check] if: needs.dedupe-check.outputs.skip_tests != 'true' && needs.check-frontend-only.outputs.skip_frontend != 'true' steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -636,13 +635,13 @@ jobs: needs: [check-frontend-only, dedupe-check] if: always() && needs.dedupe-check.outputs.skip_tests != 'true' && needs.check-frontend-only.outputs.skip_frontend != 'true' steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -733,13 +732,13 @@ jobs: cache_name: web-cache timeout: 30 steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -917,13 +916,13 @@ jobs: cache_name: web-cache timeout: 30 steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -1296,13 +1295,13 @@ jobs: if: success() && (github.ref_name == 'develop' || github.ref_name == 'main') needs: deploy-staging steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -1349,13 +1348,13 @@ jobs: if: success() && (github.ref_name == 'develop' || github.ref_name == 'main') needs: deploy-staging steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }} @@ -1429,13 +1428,13 @@ jobs: cache_name: web-cache timeout: 30 steps: + - name: Checkout code - name: Zombie run selfcheck shell: sh env: GITHUB_TOKEN: ${{ github.token }} GITHUB_RUN_ID: ${{ github.run_id }} run: bash scripts/ci/ci_run_selfcheck.sh - - name: Checkout code shell: sh env: GITHUB_TOKEN: ${{ github.token }}