[Travis] Only run on OS X for the examples

parent 3d208c0d
osx_image: xcode7.3
language: objective-c
cache: bundler cache: bundler
matrix:
include:
- rvm: system
env: COCOAPODS_CI_TASKS=EXAMPLES
osx_image: xcode7.3
language: objective-c
- rvm: 2.3.1
env: COCOAPODS_CI_TASKS=LINT
git:
submodules: false
rvm: rvm:
# OS X 10.9.5-10.10.0 (2.0.0-p481) # OS X 10.9.5-10.10.0 (2.0.0-p481)
- system - 2.0.0-p481
# OS X 10.9.3-10.9.4 # OS X 10.9.3-10.9.4
- 2.0.0-p451 - 2.0.0-p451
# OS X 10.9.0-10.9.2 # OS X 10.9.0-10.9.2
...@@ -11,6 +21,9 @@ rvm: ...@@ -11,6 +21,9 @@ rvm:
# - 2.0.0-p247 # - 2.0.0-p247
- 2.3.1 - 2.3.1
env:
- COCOAPODS_CI_TASKS=SPECS
branches: branches:
only: only:
- master - master
...@@ -19,16 +32,15 @@ branches: ...@@ -19,16 +32,15 @@ branches:
before_install: before_install:
# There is a bug in travis. When using system ruby, bundler is not # There is a bug in travis. When using system ruby, bundler is not
# installed and causes the default install action to fail. # installed and causes the default install action to fail.
- sudo gem install bundler - if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem install "bundler:~> 1.13"; else gem install "bundler:~> 1.13"; fi
# RubyGems 2.0.14 isn't a fun time on 2.0.0p648 # RubyGems 2.0.14 isn't a fun time on 2.0.0p648
- if [ "$(ruby -v | cut -d ' ' -f2)" = "2.0.0p648" ]; then sudo gem update --system; fi - if [ "$TRAVIS_RUBY_VERSION" = "system" ]; then sudo gem update --system; fi
before_script: before_script:
- bundle exec pod repo update --silent
- bundle exec pod env - bundle exec pod env
script: script:
- bundle exec rake - bundle exec rake spec:all
- bundle exec danger - bundle exec danger
addons: addons:
......
...@@ -136,25 +136,40 @@ begin ...@@ -136,25 +136,40 @@ begin
# to be run separately. # to be run separately.
# #
task :all => 'fixture_tarballs:unpack' do task :all => 'fixture_tarballs:unpack' do
tasks = ENV.fetch('COCOAPODS_CI_TASKS') { 'ALL' }.upcase.split(/\s+/)
if %w(ALL SPECS EXAMPLES LINT).&(tasks).empty?
raise "Unknown tasks #{tasks} -- supported options for COCOAPODS_CI_TASKS are " \
'ALL, SPECS, EXAMPLES, LINT'
end
specs = %w(ALL SPECS).&(tasks).any?
examples = %w(ALL EXAMPLES).&(tasks).any?
lint = %w(ALL LINT).&(tasks).any?
# Forcing colored to be included on String before Term::ANSIColor, so that Inch will work correctly. # Forcing colored to be included on String before Term::ANSIColor, so that Inch will work correctly.
require 'colored' require 'colored'
ENV['GENERATE_COVERAGE'] = 'true' ENV['GENERATE_COVERAGE'] = 'true'
puts "\033[0;32mUsing #{`ruby --version`}\033[0m" puts "\033[0;32mUsing #{`ruby --version`}\033[0m"
title 'Running the specs' if specs
sh "bundle exec bacon #{specs('**/*')}" title 'Running the specs'
sh "bundle exec bacon #{specs('**/*')}"
title 'Running Integration tests' title 'Running Integration tests'
sh 'bundle exec bacon spec/integration.rb' sh 'bundle exec bacon spec/integration.rb'
end
title 'Running examples' if examples
Rake::Task['examples:build'].invoke title 'Running examples'
Rake::Task['examples:build'].invoke
end
title 'Running RuboCop' if lint
Rake::Task['rubocop'].invoke title 'Running RuboCop'
Rake::Task['rubocop'].invoke
title 'Running Inch' title 'Running Inch'
Rake::Task['inch'].invoke Rake::Task['inch'].invoke
end
end end
namespace :fixture_tarballs do namespace :fixture_tarballs do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment