Add main build validation for release workflow #237
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.
Issue #, if available:
Description of changes:
Context: our release build workflow should be blocked on unsuccessful release tests. Since the main build already runs on release branches and contains E2E tests, add a job that only proceeds after the tests are successful. If the most recent E2E test workflow is unsuccessful, the release workflow will exit unsuccessfully.
The original action used for this validation is lewagon/wait-on-check-action. However, the logic for this check requires all instances of the dependent workflow to be successful. So, I forked the repo and added this change so that only the most recent workflow result is considered. Thus, if the main build's E2E test initially fails, ensuing reruns if passing will allow the release workflow to proceed.
Testing:
Tested sample workflow containing this job that depends on another dummy workflow to pass. Outputs pasted below
Failing case 1 (no instances of workflow)
Failing case 2 (most recent workflow run failed)
Passing case (most recent workflow run succeeded)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.