fix: gate image publishing on the test job - #68
Merged
gordonmurray merged 1 commit intoAug 1, 2026
Conversation
The build and test jobs had no dependency between them, so both started at the same time. Since build publishes to ghcr.io on any event that is not a pull request, a push to main published images before the tests finished, and published them even when the tests failed. Adding needs: test makes the build matrix wait for the test matrix. On a recent run of main the test jobs finished 32 seconds in and the builds took about four minutes, so the wait costs roughly half a minute.
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.
Fixes #66
The
buildandtestjobs had no dependency between them, so both started at the same time. Sincebuildpublishes to ghcr.io on any event that is not a pull request, a push tomainpublished images before the tests finished, and published them even when the tests failed.needs: testmakes the build matrix wait for the whole test matrix.Cost
On a recent run of
main, the seven test jobs all finished 32 seconds after the workflow started, and the seven builds took about four minutes. The wait costs roughly half a minute.Pull requests now also wait for the tests before building. They never published anything, so the only change there is ordering.
Test plan
.github/workflows/release.ymlparses,build.needsistest, and the graph has no cycleThe workflow only runs on
main, tags, and pull requests, so the change itself first runs on this PR.