Skip to content

Commit

Permalink
Updating Rakefile for travis and adding travis config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Rodriguez committed Mar 8, 2015
1 parent a1af98a commit b8cb23b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rvm:
- 2.1
- 2.2

bundler_args: --without development integration kitchen_docker kitchen_vagrant kitchen_cloud kitchen_common

env:
- USE_SYSTEM_GECODE=1

before_install:
- sudo apt-get -y -qq install libgecode-dev

script:
- bundle exec rake travis:ci
44 changes: 44 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require 'bundler/setup'
require 'rubocop/rake_task'
require 'foodcritic'
require 'kitchen'
require 'rspec/core/rake_task'

# Unit Tests. rspec/chefspec
RSpec::Core::RakeTask.new(:unit)

# Style tests. Rubocop and Foodcritic
namespace :style do
desc 'Run Ruby style checks'
RuboCop::RakeTask.new(:ruby)

desc 'Run Chef style checks'
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any']
}
end
end

desc 'Run all style checks'
task style: ['style:chef', 'style:ruby']

# Integration tests. Kitchen.ci
namespace :integration do
desc 'Run Test Kitchen with Vagrant'
task :vagrant do
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each do |instance|
instance.test(:always)
end
end
end

# We cannot run Test Kitchen on Travis CI yet...
namespace :travis do
desc 'Run tests on Travis'
task ci: %w(style unit)
end

# The default rake task should just run it all
task default: ['travis:ci', 'integration']

0 comments on commit b8cb23b

Please sign in to comment.