Repository navigation
fix(ci): stop the two copies of Tests cancelling each other on main - #160
Merged
Merged
Conversation
tests.yml kept its own `push: [main]` trigger while also being called as a
reusable job from build.yml. Every main push therefore started TWO copies of
the workflow on the same ref, and the concurrency group
(`${{ github.workflow }}-${{ github.ref }}`, cancel-in-progress) let one cancel
the other. The nested call lost: build.yml ran with a `skipped` build job and
no tests at all, so the image publish silently had no gate behind it.
Observed on the #159 merge: "Build & Push" concluded `failure` with exactly one
job, `build: skipped`, and no tests job in the run at all, while the standalone
Tests run on the same sha was green.
tests.yml now triggers on `pull_request` and `workflow_call` only. On main it
runs once, as the job build.yml gates on - which is what the comment in
build.yml always claimed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tests.ymlkept its ownpush: [main]trigger while also being called as a reusable job frombuild.yml. Every main push therefore started two copies of the workflow on the same ref, and the concurrency group (${{ github.workflow }}-${{ github.ref }},cancel-in-progress: true) let one cancel the other.The nested call lost. Observed on the #159 merge:
So the image publish silently had no gate behind it — the exact thing
build.needs: [tests]exists to guarantee. This is a regression I introduced when I added concurrency tobuild.yml, and it only shows up onmain, never on a PR.tests.ymlnow triggers onpull_request+workflow_callonly. On main it runs once, as the jobbuild.ymlgates on — which is what the comment inbuild.ymlalways claimed.Branch protection's required checks (
unit,docker,e2e, scans) are unaffected: those still fire onpull_request, which is where they gate a merge.Verification
actionlintexit 0; triggers confirmed as['pull_request', 'workflow_call'].Build & Pushshould run two jobs (tests, thenbuild), not one skippedbuild.