Skip to content

Continuous Integration

Gabriel Lebec edited this page Sep 30, 2016 · 8 revisions

In deployed applications, one method of releasing updates is continuous integration — new changes are checked in several times a day, with automated test suites to verify the build. CI services can hook into GitHub and enable features like running test suites for every PR, grading code quality, automatically deploying the most recent updates to the live app, etc.

There are many good CI services out there. Some of the most popular include:

This Gist will walk you through setting up the latter, which is free for open source projects and does not require adding any files to your project.

Codeship

For user-owned projects, the following steps will have to be performed by the user whose account hosts the repo. For organization-owned projects, the following steps can be performed by any admin-level user within the organization.

Initializing your project

  1. Visit https://www.codeship.io/ and sign up with your GitHub account.
  2. Authorize Codeship to read your GitHub account info (email, repos).
  3. Fill out the required sections of their questionnaire (experience level, number of engineers).
  4. Select the GitHub icon to read a GitHub project.
  5. Enter the clone URL of a GitHub project.

Configuring your project

Under Setup Commands, replace the sample code with the following:

psql -c 'create database fsg;'
psql -c 'create database "testing-fsg";'
nvm use v6
npm install -g gulp
npm install

Under Test Commands, replace the sample code with the following:

gulp testServerJS
gulp testBrowserJS

Finally, save your changes.

Kicking off a Test

Codeship automatically added a web hook to the repo when you connected it. The next time you push a commit (or new branch) or make a PR, it will kick off a test for you. Monitor the build and make sure it goes through; ask an instructor for help if there are any errors.

That's it! From now on you'll get automated online feedback in your PRs notifying you if tests fail. Naturally, this is more helpful if you've written thorough tests.