Skip to content

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

Merged
merged 1 commit into from
Aug 8, 2014

Conversation

RReverser
Copy link
Contributor

Currently recognized patterns:

  • any Markdown files (*.md)
  • any files in docs or examples directories.

Closes #1768.

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))/' || {
Copy link
Member

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?

Copy link
Contributor Author

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".

Copy link
Contributor Author

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?

zpao added a commit that referenced this pull request Aug 8, 2014
Cancelling Travis build on commits with docs updates only.
@zpao zpao merged commit c506b44 into facebook:master Aug 8, 2014
@RReverser RReverser deleted the stop-travis-on-docs branch August 8, 2014 20:31
@RReverser
Copy link
Contributor Author

@zpao I assume this was "yes" :)

@zpao
Copy link
Member

zpao commented Aug 11, 2014

It was :)

@RReverser
Copy link
Contributor Author

@zpao Nice, seems to work: https://travis-ci.org/facebook/react/jobs/32250596

RReverser added a commit to RReverser/react that referenced this pull request Sep 5, 2014
RReverser added a commit to RReverser/react that referenced this pull request Sep 5, 2014
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.
hdhoang added a commit to hdhoang/anne-key that referenced this pull request Mar 1, 2018
hdhoang added a commit to hdhoang/anne-key that referenced this pull request Mar 1, 2018
blackholegalaxy added a commit to blackholegalaxy/gitlab-registry-pruner-docker that referenced this pull request Apr 15, 2018
ntwb pushed a commit to WordPress/gutenberg that referenced this pull request Aug 9, 2018
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't run travis for documentation-only changes
2 participants