Why: checks only protect main if a PR can't merge while they fail, and a release shouldn't publish a build that fails its tests.
What:
- Branch protection (or a ruleset) on
main that requires the test.yml jobs to pass.
- Make
publish.yml run the tests first. For example, turn test.yml into a reusable workflow (workflow_call) and add needs: to the publish job.
References:
Why: checks only protect
mainif a PR can't merge while they fail, and a release shouldn't publish a build that fails its tests.What:
mainthat requires thetest.ymljobs to pass.publish.ymlrun the tests first. For example, turntest.ymlinto a reusable workflow (workflow_call) and addneeds:to the publish job.References:
xvfb-run ... npm run test) in its packaging job, and publishingneeds:that job: https://github.com/redhat-developer/vscode-java/blob/main/.github/workflows/release.yml