From b8cb23b72647147ef1652fbf7b0fd9ef62c64df6 Mon Sep 17 00:00:00 2001 From: Ray Rodriguez Date: Sun, 8 Mar 2015 11:31:17 -0400 Subject: [PATCH] Updating Rakefile for travis and adding travis config --- .travis.yml | 14 ++++++++++++++ Rakefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .travis.yml create mode 100644 Rakefile diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..11e961e --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..190487b --- /dev/null +++ b/Rakefile @@ -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']