-
Notifications
You must be signed in to change notification settings - Fork 48.6k
Cancelling Travis build on commits with docs updates only. #2000
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
Conversation
Currently recognized patterns: * any Markdown files (*.md) * any files in docs or examples directories. Closes facebook#1768.
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then | ||
TRAVIS_COMMIT_RANGE="FETCH_HEAD...$TRAVIS_BRANCH" | ||
fi | ||
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/' || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to match and bail if a documentation change is in the same PR/commit as a change to code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What it basically says is "if there're no other changed files but docs/examples, immediately exit".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zpao Does this answer your question?
Cancelling Travis build on commits with docs updates only.
@zpao I assume this was "yes" :) |
It was :) |
@zpao Nice, seems to work: https://travis-ci.org/facebook/react/jobs/32250596 |
…ged. See facebook#1768 / facebook#2000 for original issue. See travis-ci/travis-ci#1719 (comment) for origin of this solution.
See facebook#1768 / facebook#2000 for original issue. See travis-ci/travis-ci#1719 (comment) for problem description and origin of this fix. This is still a temporary fix until travis-ci/travis-core#383 is merged.
Adapted from facebook/react#2000. Close #2.
Adapted from facebook/react#2000. Close #2.
…8728) This comes from [a discussion](https://wordpress.slack.com/archives/C02QB2JS7/p1533720310000209) with @gziolo in #core-editor. Basically we can skip the full Travis build if the commit range being tested only contains changes to `.md` files. Modeled after: facebook/react#2000 In my testing, this shortens the Travis run time on each item in the test list from ~4-6 minutes down to ~1 minute or less for docs only changes. Should help speed up merging non-code PRs. Here are some test builds I did from my fork: [Only change .md file](https://travis-ci.org/earnjam/gutenberg/builds/413732648) - aborts early [Only change .js file](https://travis-ci.org/earnjam/gutenberg/builds/413733458) - runs normally [Changes both .md and .js files](https://travis-ci.org/earnjam/gutenberg/builds/413733882) - runs normally
Currently recognized patterns:
Closes #1768.