Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CI to handle skipping docs #5207

Merged
merged 3 commits into from
Apr 20, 2022
Merged

Refactor CI to handle skipping docs #5207

merged 3 commits into from
Apr 20, 2022

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Apr 16, 2022

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, and smoke-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):

image

Here's the routing for a regular PR that includes code changes:

image

Step by step, here's what happens:

  • The "Only docs changes" job runs, figures out if ONLY docs changed (see below)
  • If more than just docs changed, the "Check" job runs, which runs yarn check, making sure the basics look ok before launching an onslaught of jobs
  • If check passes, 10 jobs are triggered:
    • Build, lint, test x 4
    • Tutorial e2e x 2
    • Smoke test x 4

A 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:

image

(Here's what it looked like before for reference)

image


Lastly, here's the files that this action considers docs:

for (const changedFile of changedFiles) {
if (changedFile.startsWith('docs')) {
continue
}
for (const fileToIgnore of [
'CHANGELOG.md',
'CODE_OF_CONDUCT.md',
'CONTRIBUTING.md',
'CONTRIBUTORS.md',
'LICENSE',
'README.md',
'SECURITY.md',
]) {
if (changedFile === fileToIgnore) {
continue
}
}

@jtoar jtoar added topic/ops-&-contributing-dx release:chore This PR is a chore (means nothing for users) labels Apr 16, 2022
@jtoar jtoar self-assigned this Apr 16, 2022
@netlify
Copy link

netlify bot commented Apr 16, 2022

Deploy Preview for redwoodjs-docs canceled.

Name Link
🔨 Latest commit 51880bd
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/625f8eebd2f1820009cb3496

@thedavidprice
Copy link
Contributor

Looking good! I think I'll need to walk through this one with you in real-time. Possible?

@jtoar jtoar merged commit 941a18b into main Apr 20, 2022
@jtoar jtoar deleted the ds-refactor-ci branch April 20, 2022 05:09
@jtoar jtoar added this to the next-release milestone Apr 20, 2022
@thedavidprice thedavidprice modified the milestones: next-release, v1.2.0 Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users) topic/ops-&-contributing-dx
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants