ci: make steps conditional in 'test python' workflow
Metadata
Current evaluation
Merged in canonical/starflow#146 via d691e4b, adding step-level conditions so docs-only changes skip test work while matrix-spawned required checks still start and pass.
Resolution: closed resolved
Reason: Commit d691e4b merged the workflow change and applied source-file conditions to each Test Python step. This allows required matrix checks to complete while bypassing test execution for docs-only changes.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The intent is to make the test jobs conditional for docs-only changes. The technical circumstances are:
1. In most of our repos, only two of the matrix-spawned test jobs are required checks. So while most of the test jobs can fail, we can't skip the workflow completely.
2. Required jobs can't be skipped by a conditional if they're spawned by a matrix. If we make the job conditional, the required check will never be satisfied, and CI will idle forever waiting for it to start. This is a bug or flaw with GitHub. So we need another way to bypass the job's behaviour, while still letting it start.
The simplest workaround is to give each step in the job a conditional `if`. In effect, they all initiate but then immediately end. The job then technically passes, and is considered satisfied as far as GitHub is concerned.
The downside is that at a glance, the job reports that it passed, as if it had been a real run. The only way to distinguish an ersatz job is to review its runtime (less than five seconds, usually) or its log.
This solution also means that every CI run will show two different statuses for skipped checks. Regular required jobs with job-level `if`s will have the skipped status. Matrix-spawned checks will have the passed status. Therefore, our workflows will be less legible, because any CI run will show both.
Tested successfully in Rockcraft against my fork: https://github.com/canonical/rockcraft/pull/1216
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/starflow#146 via d691e4b, adding step-level conditions so docs-only changes skip test work while matrix-spawned required checks still start and pass. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/starflow#146: test-python steps now use conditionals to bypass tests for docs-only changes while allowing matrix-spawned required checks to start and pass. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged CI changes adding step-level conditionals to the test python workflow. This bypasses GitHub's matrix job skip limitation. Jobs initiate and immediately pass for docs-only changes, satisfying required checks without running tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a CI update that conditionally skips test steps for docs-only changes. GitHub cannot skip matrix-spawned required jobs, so steps run but immediately pass to satisfy checks. This bypasses execution but reduces CI legibility. |
Update history
No update history recorded yet.
Related issues
No related issues found above the similarity threshold.