Prevent Travis builds duplication

This commit changes Travis configuration file to specify a list of branches that it should build. This way Travis will only create a new build when a commit is pushed to the master branch and release branches and when tags are created. The behavior for PRs is not modified and PR creation and updates will still trigger builds.

Doing this to speed up Travis build by preventing it from running two builds for PR that are created from a branch of the same repository. Before this change, Travis would create a build when the branch is pushed to GitHub (continuous-integration/travis-ci/push) and another one when the PR is created (continuous-integration/travis-ci/pr). For an example, see https://github.com/woocommerce/woocommerce/pull/17680.
This commit is contained in:
Rodrigo Primo 2017-11-20 17:18:29 -02:00
parent b9bfc4a26b
commit 742cd367b0
1 changed files with 7 additions and 0 deletions

View File

@ -37,3 +37,10 @@ script:
after_script:
- bash tests/bin/travis.sh after
# Specifies that Travis should create builds for master and release branches and also tags.
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^release\//