Skip to content

ci(build): run test jobs only for the parts of build.yml a change touches - #7227

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
adriadam10:ci/workflow-scoped-jobs
Oct 17, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
adriadam10:ci/workflow-scoped-jobs

Conversation

@adriadam10

Copy link
Copy Markdown
Collaborator

What

Any change to build.yml ran the relinker (3 hosts), register-context (4) and write-watch (2) jobs, even when it only touched the windows or linux job (#7222 waited 7.5 min for relinker on Windows to change a ccache key).

A change to build.yml now runs a test job only if its hunks touch one of these:

  • that job's own section
  • the eligibility job
  • anything outside jobs: (triggers, env, permissions)

The job sections come from the workflow at the head, with jobs at two-space indent under jobs:. Hunk lines are mapped through the patch line numbers. A deleted line counts for the jobs on both sides of it.

If the patch is missing (very large diffs), the file was renamed, or the content can't be read, every job runs, as before.

Tested

The mapping was run in node on the real patches of the open PRs that touch build.yml, against each PR's head:

PR Jobs touched
#7222 windows
#6932 linux
#7096 relinker
#7197 eligibility relinker
#7097 relinker-asan (a new job)

Two synthetic cases:

  • An env edit gives the shared section, so every job runs.
  • A line deleted inside relinker gives relinker.

actionlint passes. This PR touches the eligibility job, so its own run takes the "every job" path and exercises the content read against the API.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

…ches

A change to build.yml ran the relinker, register-context and write-watch jobs whatever it touched. The patch's lines are now mapped to the job sections of the workflow at the head, and a test job runs only if its own section, the eligibility job or the shared part outside jobs changed; without a patch every job runs as before.

Co-Authored-By: Claude <noreply@anthropic.com>
@adriadam10
adriadam10 merged commit e383833 into boykopovar:main Oct 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant