From 10ad48cc13b24d0a2f604e33a09e0656c19aad89 Mon Sep 17 00:00:00 2001 From: chengyongru <2755839590@qq.com> Date: Thu, 22 Oct 2026 23:51:20 +0800 Subject: [PATCH] ci: isolate Test Suite runs by revision --- .github/workflows/ci.yml | 3 ++- tests/scripts/test_ci_workflows.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b76e45851..da4a6345f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ on: branches: [main] concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + # Re-runs retain their original SHA; only checks of the same revision may supersede each other. + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }} cancel-in-progress: true permissions: diff --git a/tests/scripts/test_ci_workflows.py b/tests/scripts/test_ci_workflows.py index f1223595b..1d54783d8 100644 --- a/tests/scripts/test_ci_workflows.py +++ b/tests/scripts/test_ci_workflows.py @@ -42,6 +42,12 @@ def test_accepted_handoff_uses_the_producer_id_and_requires_native_success(): assert "name" not in download["with"] +def test_ci_runs_for_distinct_revisions_do_not_cancel_each_other(): + concurrency = workflow("ci.yml")["concurrency"] + assert concurrency["group"] == "${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}" + assert concurrency["cancel-in-progress"] == "true" + + def test_windows_installer_matrix_has_an_independent_required_job(): jobs = workflow("ci.yml")["jobs"] installer = jobs["windows_installers"]