From 477b79b7f66c458366f08c0751b646e405d21403 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 12 May 2016 11:55:48 +1000 Subject: [PATCH] Configure Travis to support MiniRacer and TheRubyRacer simultaneously. --- .gitignore | 1 + .travis.yml | 29 +++++++++++++++++++++++++---- Gemfile | 9 ++++++--- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 033a8fc..6ebd965 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Gemfile.lock pkg/* +.bundle/* diff --git a/.travis.yml b/.travis.yml index 8c0ef70..d48e11e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,13 @@ language: ruby cache: bundler sudo: false +# we need trust so correct gcc runs for mini_racer, latest v8 requires gcc 4.8+ before_install: - if [ "$EXECJS_RUNTIME" == "V8" ]; then brew update; fi - if [ "$EXECJS_RUNTIME" == "V8" ]; then brew install v8; fi -script: bundle exec ruby test/test_execjs.rb + - if [ "$EXECJS_RUNTIME" == "MiniRacer" ]; then gem install bundler -v 1.12.0; fi +script: bundle && bundle exec ruby test/test_execjs.rb matrix: include: @@ -15,6 +17,10 @@ matrix: env: EXECJS_RUNTIME=Duktape - rvm: 2.0.0 env: EXECJS_RUNTIME=RubyRacer + - rvm: 2.0.0 + env: EXECJS_RUNTIME=MiniRacer + dist: trusty + sudo: true - rvm: 2.1 env: EXECJS_RUNTIME=Node @@ -22,6 +28,10 @@ matrix: env: EXECJS_RUNTIME=Duktape - rvm: 2.1 env: EXECJS_RUNTIME=RubyRacer + - rvm: 2.1 + env: EXECJS_RUNTIME=MiniRacer + dist: trusty + sudo: true - rvm: 2.2 env: EXECJS_RUNTIME=Node @@ -29,13 +39,21 @@ matrix: env: EXECJS_RUNTIME=Duktape - rvm: 2.2 env: EXECJS_RUNTIME=RubyRacer + - rvm: 2.2 + env: EXECJS_RUNTIME=MiniRacer + dist: trusty + sudo: true - - rvm: 2.3.0 + - rvm: 2.3.1 env: EXECJS_RUNTIME=Node - - rvm: 2.3.0 + - rvm: 2.3.1 env: EXECJS_RUNTIME=Duktape - - rvm: 2.3.0 + - rvm: 2.3.1 env: EXECJS_RUNTIME=RubyRacer + - rvm: 2.3.1 + env: EXECJS_RUNTIME=MiniRacer + dist: trusty + sudo: true - rvm: jruby-19mode env: EXECJS_RUNTIME=Node @@ -52,3 +70,6 @@ matrix: env: EXECJS_RUNTIME=RubyRacer - os: osx env: EXECJS_RUNTIME=V8 + - os: osx + env: EXECJS_RUNTIME=MiniRacer + osx_image: xcode7.3 diff --git a/Gemfile b/Gemfile index 200b5ae..7aabdc2 100644 --- a/Gemfile +++ b/Gemfile @@ -4,8 +4,11 @@ gemspec group :test do gem 'duktape', platform: :mri - gem 'therubyracer', platform: :mri - gem 'therubyrhino', ">=1.73.3", platform: :jruby + if ENV['EXECJS_RUNTIME'] == 'MiniRacer' + gem 'mini_racer', '0.1.0.beta.3', platform: :mri + else + gem 'therubyracer', platform: :mri + end + gem 'therubyrhino', '>=1.73.3', platform: :jruby gem 'minitest', require: false - gem 'mini_racer', platform: :mri end