Skip to content

Run only the pipeline jobs a change needs #128

Todo

Description

@stphnwlsh

Every pull request runs the whole Build Pipeline, whatever it touches. A pull request that changed five skill files (CleanMinimalApi #102) still ran Build, Test, both Static Analysis jobs, Dependency Review and Container Scan, about seven and a half minutes of runner time to check Markdown. The pipeline should work out what a change touches and run only the jobs that can say something about it.

What runs for what

A change that touches Runs
src/, tests/, *.props, *.slnx, global.json, .editorconfig, Dockerfile, compose.yaml, .template.config/ Everything, as today
.github/workflows/ or .github/actions/ Everything, as today
Only what the package ships besides code: .agents/, AGENTS.md, CLAUDE.md, template/, docs/RUN.md, NUGET.md Build (it packs and verifies the template), Static Analysis (actions) and Summary
Only repository documents: README.md, CONTRIBUTING.md, the community files, LICENSE, issue forms Summary

The scheduled maintenance and release runs, and manual runs, always run everything.

Phase 1: Prove it on CleanMinimalApi

  • dorny/paths-filter is on the organisation's list of allowed actions
  • A first job uses dorny/paths-filter, pinned to a commit like the other third-party actions, to work out which of the groups above a pull request or push touches
  • Each job runs only when its group is touched, and reports as skipped otherwise
  • Confirm a skipped job satisfies its required check, including the two Static Analysis matrix checks, whose names only exist once the matrix expands
  • Confirm the code scanning rule on main lets a pull request merge when CodeQL didn't run on it
  • Summary shows a job that wasn't needed as "not needed", not as a failure, and still fails when a job that ran failed
  • Try four pull requests: code, a workflow, a skill, the README

Phase 2: Carry it to the other four

  • The same workflow change in MCP, GraphQL, Web API and Lambda Function
  • ci-pipeline skill says what runs for what

Not in scope: the starter ci.yml that ships to generated solutions stays as simple as it is.

Checks: the four trial pull requests run only the jobs in the table and can be merged, a scheduled run still runs everything, and Shared Layers Drift finds no differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions