From 0c65483a2304d987314f08ae5c58bf24185af4c9 Mon Sep 17 00:00:00 2001 From: huangduican Date: Tue, 13 Oct 2026 15:15:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(accelerate):=20=E5=BC=80=E5=90=AF=20pull?= =?UTF-8?q?=5Frequest=20=E8=A7=A6=E5=8F=91=EF=BC=8C=E5=AF=B9=E9=BD=90=20pe?= =?UTF-8?q?ft=20=E7=9A=84=20PR=20=E8=A7=A6=E5=8F=91=E4=B8=8E=E5=B9=B6?= =?UTF-8?q?=E5=8F=91=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/accelerate-examples.yml | 28 ++++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/accelerate-examples.yml b/.github/workflows/accelerate-examples.yml index bc43d2208..728cae943 100644 --- a/.github/workflows/accelerate-examples.yml +++ b/.github/workflows/accelerate-examples.yml @@ -10,12 +10,16 @@ name: accelerate-examples concurrency: - # schedule runs serialize; each manual run gets its own group so a - # dispatch is never blocked behind a scheduled run. - group: ${{ github.event_name == 'schedule' && 'accelerate-examples-schedule' || format('manual-{0}', github.run_id) }} - # false: a run cancelled mid-way loses its outcome writeback, and the - # outcome is what drives the next cycle's retry. - cancel-in-progress: false + # Three groups: schedule runs serialize (a run cancelled mid-way + # loses its outcome writeback, and the outcome drives the next + # cycle's retry); each PR serializes per number so a new push + # cancels the stale run instead of queueing another matrix on the + # NPU runners; each manual run stands alone. Group names are + # repository-wide, so the PR group carries the workflow name. + group: ${{ github.event_name == 'schedule' && 'accelerate-examples-schedule' || (github.event_name == 'pull_request' && format('accelerate-examples-pr-{0}', github.event.pull_request.number)) || format('manual-{0}', github.run_id) }} + # true on PR runs only: a stale push's matrix should be cancelled, + # but a schedule run cancelled mid-way loses its outcome writeback. + cancel-in-progress: ${{ github.event_name == 'pull_request' }} on: # Daily at 02:00 Beijing time (UTC 18:00). @@ -28,6 +32,18 @@ on: required: false default: '' type: string + # PR runs need no merge: GitHub executes the workflow files from the + # PR merge ref, so a newly added trigger and engine run on the PR + # that adds them. `pull_request`, not `pull_request_target`: the + # declared read permissions are all the engine needs. paths lists + # only this project's files, so a PR that touches only the shared + # engine, scripts or schema starts no project's matrix. + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + paths: + - 'examples-guards/accelerate/**' + - '.github/workflows/accelerate-examples.yml' # Engine jobs query the GitHub Job API (validate-results); called # workflows run with the caller's GITHUB_TOKEN permissions.