Getting started
This is a very short guide to using Travis CI with your GitHub hosted code repository. If you’re new to continuous integration or would like some more information on what Travis CI does, start with Core Concepts for Beginners instead.
Prerequisites
To start using Travis CI, make sure you have all of the following:
- GitHub login
- Project hosted as a repository on GitHub
- Working code in your project
- Working build or test script
To get started with Travis CI
-
Using your GitHub account, sign in to either
- Travis CI .org for public repositories
- Travis CI .com for private repositories
and accept the GitHub access permissions confirmation.
-
Once you’re signed in to Travis CI, and we’ve synchronized your GitHub repositories, go to your profile page and enable the repository you want to build:

-
Add a
.travis.ymlfile to your repository to tell Travis CI what to do.The following example tells Travis CI that this is a Ruby project that should be built with Ruby 2.2, and the latest versions of JRuby and Rubinius 2.X.
language: ruby rvm: - 2.2 - jruby - rbx-3The defaults for Ruby projects are
bundle installto install dependencies, andraketo build the project. -
Add the
.travis.ymlfile to git, commit and push, to trigger a Travis CI build:Travis only runs builds on the commits you push after you’ve enabled the repository in Travis CI.
-
Check the build status page to see if your build passes or fails, according to the return status of the build command:
- Travis CI .org build status for public repositories
- Travis CI .com build status for private repositories
Selecting a different programming language
Use one of these common languages:
language: ruby
language: java
language: node_js
language: python
language: php
Or pick one from the full list.
Selecting infrastructure (optional)
The best way to determine what infrastructure your build runs on
is to set the language. If you do this your build runs on the default
infrastructure (with a few exceptions), which is Container Based Ubuntu 14.04.
You can explicitly select the default infrastructure by adding sudo: false to your .travis.yml.
-
If you need a more customizable environment running in a virtual machine, use the Sudo Enabled infrastructure:
sudo: enabled -
If you have tests that need to run on macOS, or your project uses Swift or Objective-C, use our OS X environment:
os: osxYou do not necessarily need to use OS X if you develop on a Mac, only if you need Swift, Objective-C or other macOS-specific software.
More than running tests
Travis CI isn’t just for running tests, there are many others things you can do with your code:
- deploy to GitHub pages
- run apps on Heroku
- upload RubyGems
- send notifications
Further Reading
Read more about