Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI creates two builds for each Github commit push

Tags:

Each time I push to Github, it appears to trigger two Travis CI builds - one for the PR and one for the Push itself. They also appear to be separate builds, judging by the links.

What's the exact difference between the two, and how can I enable it so that only one runs?

travis ci build

like image 901
user2490003 Avatar asked Jan 24 '16 11:01

user2490003


People also ask

Is Travis CI a CI tool?

Like Jenkins, Travis CI is also one of the early players in the CI/CD tools market. The tool is written in Ruby and is developed & maintained by the Travis CI community. Travis CI was earlier available only for GitHub hosted projects but now it also supports Bitbucket hosted projects.

What is build in pull request?

A Pull Request Build is a build of a non-production branch of your site. Pull Request Builds are intended to show the impact of potential code changes before merging those changes into your production branch.


2 Answers

You can uncheck either building pushes or PRs in the TravisCI settings for the repository: settings SS

The difference between them is:

  • /pr builds automerged state (as if you merged the PR and ran the tests on that, note: it won't run if the PR can't be automerged).
  • /push builds for the current state of the branch you pushed to (as if you ran the tests on your local copy you just pushed),
like image 192
набиячлэвэли Avatar answered Oct 29 '22 09:10

набиячлэвэли


What's happening in your scenario looks like this:

continuous-integration/travis-ci/push - only run test on branch

continuous-integration/travis-ci/pr - merge and run tests

And this is completely okay - but if you want to get rid of one of the builds you need to disable Build pushes or Build pull requests in your project settings on Travis.


Sources:

https://github.com/travis-ci/travis-ci/issues/1504

https://github.com/twisted/twistedchecker/pull/93

https://blog.travis-ci.com/2014-03-05-repository-settings/

like image 25
mkozak Avatar answered Oct 29 '22 08:10

mkozak