Skip to content

Commit

Permalink
Run Travis CI push-triggered tests only on master branch
Browse files Browse the repository at this point in the history
We want to run Travis CI in two situations:
* commits are pushed to a branch associated with a new/open PR
* a PR is merged into master

The reason we want the second situation to trigger a Travis CI run is
that we want coveralls to be able to compare coverage from the master
branch (at the point the PR diverged) and the branch associated with the
PR.

Without having the master branch Travis CI run (and consequent coveralls
data), we will not be told about *changes* in coverage, only absolute
coverage (coveralls will claim it is the "First run on ..." this
branch).

By enabling Travis CI runs to be triggered by:
* PRs, and
* pushes

and by limiting push-triggered runs to the master branch, we avoid
Travis CI runs for pushes to branches associated (or not) with PRs.

This is useful because otherwise pushing to a branch associated with a
PR causes *two* runs: the PR-trigger run and the push-trigger run.

Signed-off-by: Tim Waugh <[email protected]>
  • Loading branch information
twaugh authored and lcarva committed May 17, 2018
1 parent b92caa6 commit 4e06e13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: python
branches:
only:
- master
sudo: "required"
services:
- docker
Expand Down

0 comments on commit 4e06e13

Please sign in to comment.