title | layout | redirect_from | |
---|---|---|---|
Travis CI Tutorial |
en |
|
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.
To start using Travis CI, make sure you have:
- A GitHub account.
- Owner permissions for a project hosted on GitHub.
-
Go to Travis-ci.com and Sign up with GitHub.
-
Accept the Authorization of Travis CI. You'll be redirected to GitHub.
-
Click the green Activate button, and select the repositories you want to use with Travis CI.
-
Add a
.travis.yml
file to your repository to tell Travis CI what to do.The following example specifies a Ruby project that should be built with Ruby 2.2 and the latest versions of JRuby.
language: ruby rvm: - 2.2 - jruby
{: data-file=".travis.yml"}
The defaults for Ruby projects are
bundle install
to install dependencies, andrake
to build the project. -
Add the
.travis.yml
file to git, commit and push, to trigger a Travis CI build:Travis only runs builds on the commits you push after you've added a
.travis.yml
file. -
Check the build status page to see if your build passes or fails, according to the return status of the build command by visiting the Travis CI and selecting your repository.
Use one of these common languages:
language: ruby
{: data-file=".travis.yml"}
language: java
{: data-file=".travis.yml"}
language: node_js
{: data-file=".travis.yml"}
language: python
{: data-file=".travis.yml"}
language: php
{: data-file=".travis.yml"}
If you have tests that need to run on macOS, or your project uses Swift or Objective-C, use our OS X environment:
os: osx
{: data-file=".travis.yml"}
You do not necessarily need to use OS X if you develop on a Mac. OS X is required only if you need Swift, Objective-C or other macOS-specific software.
Travis CI supports many programming languages.
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
Read more about