Getting started with GitHub and Travis CI

First of all, what is CI?

Continuous Integration (CI) is a merging of all developers’ committed code to a repository several times a day. Each commit triggered the automation build script to compile the solution. Moreover, deployment of the committed code to the host server can be performed automatically.

Compilation result can be sent as email notification.

Advantage

  • This enables early detection of errors in the code.
  • Allow for automatic deployment to host server.
  • Prevent long and tense integrations of code.

This tutorial will help you in linking your GitHub Repository and your Travis CI.

25231    GitHub

You need to first have a GitHub account. If not, go to GitHub and click on the Sign Up button.

Already have your account? Cool, let’s proceed to the next step.

After login to your GitHub account, make sure you have at least one repository available. Also, you need to have .travis.yml file so that to enable compilation of your code.

The .travis.yml is a script that defines the programming language being used for your code and your solution name, hence allowing Travis CI to know what type of compiler is required to build your solution.

Go to Travis Documentation and select your programming language you are using. This will help you to create your .travis.yml file.

For me, since it is C#, my .travis.yml looks like this:

Travis Yml file

Place the .travis.yml file to the root of your solution.

travis-ci-icon    Travis CI

Go to Travis CI and create an account with GitHub.

After you have all your accounts in place, on Travis CI, hover on your username on top right corner and click on account. Travis CI will then fetch the repositories from GitHub

Travis Repo

Toggle the button of the repository you want to link with Travis CI and click on the Travis CI logo to go back to your dashboard. There you’ll find your repository.

Repo list

Now your code for the repository that you have linked with Travis CI will be compiled after each commit you made on your GitHub Repository. After each compilation, you’ll receive an email to about the compilation result.

Advertisements

One thought on “Getting started with GitHub and Travis CI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s