Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Travis CI config file for Node.js and Ruby in one repo
# As of writing this (7/4/2015) Travis CI only supports one language per project
# However, every box comes with Node.js and Ruby pre-installed.
# On top of it, you can install custom programs/libraries in the the `before_script` or 'before_install`
# stages.
# The easiest approach is to go with Node.js box and install approprtiate Ruby version
# or vice-versa
language: node_js
# pick your version of Node.js
- 0.12.2
postgresql: "9.4"
# For now every Node.js box comes with Ruby 1.9.3 by default
# Let's make sure we can install Ruby 2.2.2
# Check that default ruby changes after `rvm install` step
- ruby --version
- rvm install 2.2.2
- ruby --version
# run whatever you have to do here. I have Makefile that lets you install
# all Node.js-related or Ruby-related dependencies as one step.
- make npm
- make bundler
# My Rails app lives in a subdirectory. I want to make sure that
# my database is ready before I start running RSpec tests
- psql -c 'create database moovcheckout_test;' -U postgres
# I use separate database.yml config for Travis CI - it's super simple
- cp webapp/config/database.travis.yml webapp/config/database.yml
# `test` target executes `bundle exec rspec spec` and `npm run test`
# in all appropriate subdirectories
- make test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment