Skip to content

Instantly share code, notes, and snippets.

@mbyczkowski
Created July 4, 2015 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbyczkowski/4e827a713b39f27a38be to your computer and use it in GitHub Desktop.
Save mbyczkowski/4e827a713b39f27a38be to your computer and use it in GitHub Desktop.
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
node_js:
# pick your version of Node.js
- 0.12.2
addons:
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
before_install:
# Check that default ruby changes after `rvm install` step
- ruby --version
- rvm install 2.2.2
- ruby --version
install:
# 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
before_script:
# 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
script:
# `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