Refactor CI to handle skipping docs #5207
Merged
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.
Closes #4848.
This refactors our GitHub workflows so that our CI passes required checks for PRs with docs-only changes.
It also tweaks the names of the jobs a bit (i.e., adding emojis) to make things a little easier to read at a glance. @thedavidprice We may have to update the names of the required checks accordingly.
To do all this, I merged the
build-eslint-jest
,e2e
, andsmoke-test
workflows into one file—ci
—so I could "route" the jobs based on the files changed by a PR. But I made no changes to the workflows themselves (i.e. they still check for the same things):Here's the routing for a regular PR that includes code changes:
Step by step, here's what happens:
yarn check
, making sure the basics look ok before launching an onslaught of jobsA docs-only PR would just run
echo pass
for everything, passing instantly.You can see this workflow in action now, on this PR and in the Checks tab and on this page below:
(Here's what it looked like before for reference)
Lastly, here's the files that this action considers docs:
redwood/.github/actions/only_doc_changes/only_doc_changes.mjs
Lines 10 to 27 in de0f6f6