Separate default rake from rake ci

This commit is contained in:
Benjamin Fleischer 2015-10-01 23:19:04 -05:00
parent 8e1245a5b2
commit 9e3cf0241d
3 changed files with 20 additions and 9 deletions

View File

@ -17,7 +17,7 @@ install:
- bundle install --retry=3
script:
- env CAPTURE_STDERR=false bundle exec rake
- env CAPTURE_STDERR=false bundle exec rake ci
env:
- "RAILS_VERSION=4.0"

View File

@ -11,19 +11,27 @@ begin
rescue LoadError
else
Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop)
if !defined?(::Rubinius)
require 'rbconfig'
# https://github.com/bundler/bundler/blob/1b3eb2465a/lib/bundler/constants.rb#L2
windows_platforms = /(msdos|mswin|djgpp|mingw)/
if RbConfig::CONFIG['host_os'] =~ windows_platforms
desc 'No-op rubocop on Windows-- unsupported platform'
task :rubocop do
puts 'Skipping rubocop on Windows'
end
elsif defined?(::Rubinius)
desc 'No-op rubocop to avoid rbx segfault'
task :rubocop do
puts 'Skipping rubocop on rbx due to segfault'
puts 'https://github.com/rubinius/rubinius/issues/3499'
end
else
Rake::Task[:rubocop].clear if Rake::Task.task_defined?(:rubocop)
desc 'Execute rubocop'
RuboCop::RakeTask.new(:rubocop) do |task|
task.options = ['--rails', '--display-cop-names', '--display-style-guide']
task.fail_on_error = true
end
else
desc 'No-op rubocop to avoid rbx segfault'
task :rubocop do
puts 'Skipping rubocop on rbx due to segfault'
puts 'https://github.com/rubinius/rubinius/issues/3499'
end
end
end
@ -37,3 +45,6 @@ Rake::TestTask.new do |t|
end
task default: [:test, :rubocop]
desc 'CI test task'
task :ci => [:default]

View File

@ -21,6 +21,6 @@ install:
- bundle install --retry=3
test_script:
- bundle exec rake test
- bundle exec rake ci
build: off