那么如何配置这个travis ci文件,以便rails5 gemfile只测试/使用ruby 2.2.2? Activesupport 5需要ruby 2.2.2。
language: ruby
env:
- CI=true
before_script:
- "bundle exec rake db:prepare"
rvm:
- 2.0.0
- 2.1.6
- 2.2.2
gemfile:
- gemfiles/rails32.gemfile
- gemfiles/rails4.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- gemfiles/rails5beta.gemfile
notifications:
recipients:
- someone@gmail.com
- someone2@gmail.com
答案 0 :(得分:3)
您可以像这样定义构建matrix
:
language: ruby
env:
- CI=true
before_script:
- "bundle exec rake db:prepare"
matrix:
include:
- rvm: 2.0.0
gemfile:
- gemfiles/rails32.gemfile
- gemfiles/rails4.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- rvm: 2.1.6
gemfile:
- gemfiles/rails32.gemfile
- gemfiles/rails4.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- rvm: 2.2.2
gemfile:
- gemfiles/rails32.gemfile
- gemfiles/rails4.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
- gemfiles/rails5beta.gemfile
notifications:
recipients:
- someone@gmail.com
- someone2@gmail.com
答案 1 :(得分:0)
找到答案 - 显然,Travis包含一个矩阵选项,允许您不使用特定的gemfile运行某些Ruby版本(或运行它们)
matrix:
exclude:
- rvm: 2.0.0
gemfile: Gemfile
env: DB=mongodb
- rvm: 2.0.0
gemfile: Gemfile
env: DB=redis
- rvm: 2.0.0
gemfile: Gemfile
env: DB=mysql