mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Separate default rake from rake ci
This commit is contained in:
parent
8e1245a5b2
commit
9e3cf0241d
@ -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"
|
||||
|
||||
25
Rakefile
25
Rakefile
@ -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]
|
||||
|
||||
@ -21,6 +21,6 @@ install:
|
||||
- bundle install --retry=3
|
||||
|
||||
test_script:
|
||||
- bundle exec rake test
|
||||
- bundle exec rake ci
|
||||
|
||||
build: off
|
||||
|
||||
Loading…
Reference in New Issue
Block a user