瀏覽代碼

Merge pull request #257 from kishikawakatsumi/build-matrix

Use test matrix
kishikawa katsumi 9 年之前
父節點
當前提交
a29cca50f4
共有 2 個文件被更改,包括 23 次插入16 次删除
  1. 8 1
      .travis.yml
  2. 15 15
      Lib/Rakefile

+ 8 - 1
.travis.yml

@@ -14,11 +14,18 @@ before_script:
   - openssl aes-256-cbc -k "$ENCRYPTION_SECRET" -in ./Lib/Certificates/tvOS_Development.mobileprovision.enc -d -a -out ./Lib/Certificates/tvOS_Development.mobileprovision || true
   - ./Lib/Scripts/add_key.sh || true
 script:
-  - "(cd Lib && bundle exec rake build test:iphonesimulator test:appletvsimulator test:macosx coverage:coveralls test:carthage)"
+  - "(cd Lib && bundle exec rake $ACTION)"
 branches:
   only:
     - master
 env:
+  matrix:
+    - ACTION=build
+    - ACTION='build:carthage'
+    - ACTION='test:iphonesimulator:debug coverage:coveralls'
+    - ACTION='test:iphonesimulator:release coverage:coveralls'
+    - ACTION='test:appletvsimulator coverage:coveralls'
+    - ACTION='test:macosx coverage:coveralls'
   global:
     - LANG=en_US.UTF-8
     - LC_ALL=en_US.UTF-8

+ 15 - 15
Lib/Rakefile

@@ -64,6 +64,21 @@ namespace :build do
       end
     end
   end
+  
+  task :carthage do
+    sh %[echo 'github \"kishikawakatsumi/KeychainAccess\" \"#{branch_name}\"' > Cartfile]
+    sh %[carthage update --no-use-binaries]
+  end
+  
+  def branch_name
+    if ENV['CI']
+      pull_req = %[https://api.github.com/repos/#{ENV['TRAVIS_REPO_SLUG']}/pulls/#{ENV['TRAVIS_PULL_REQUEST']}]
+      auth_token = 'kishikawakatsumi:209558699492df7782fbe62dda1891d6a6ba010f'
+      (ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : `curl -u #{auth_token} -s #{pull_req} | jq -r .head.ref`).strip
+    else
+      %x[git rev-parse --abbrev-ref HEAD]
+    end
+  end
 end
 
 namespace :test do
@@ -92,21 +107,6 @@ namespace :test do
       t.formatter = 'xcpretty -c'
     end
   end
-  
-  def branch_name
-    if ENV['CI']
-      pull_req = %[https://api.github.com/repos/#{ENV['TRAVIS_REPO_SLUG']}/pulls/#{ENV['TRAVIS_PULL_REQUEST']}]
-      auth_token = 'kishikawakatsumi:209558699492df7782fbe62dda1891d6a6ba010f'
-      (ENV['TRAVIS_PULL_REQUEST'] == 'false' ? ENV['TRAVIS_BRANCH'] : `curl -u #{auth_token} -s #{pull_req} | jq -r .head.ref`).strip
-    else
-      %x[git rev-parse --abbrev-ref HEAD]
-    end
-  end
-  
-  task :carthage do
-    sh %[echo 'github \"kishikawakatsumi/KeychainAccess\" \"#{branch_name}\"' > Cartfile]
-    sh %[carthage update --no-use-binaries]
-  end
 end
 
 XCJobs::Coverage::Coveralls.new()