소스 검색

Don't run Sauce Labs tests on pull requests

Due to security restrictions within Travis CI, we cannot use secure
environment variables in pull requests.  This means that the tests
cannot be run in the Sauce Labs environment.

http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
Kevin Brown 10 년 전
부모
커밋
e8a12133f8
1개의 변경된 파일14개의 추가작업 그리고 4개의 파일을 삭제
  1. 14 4
      Gruntfile.js

+ 14 - 4
Gruntfile.js

@@ -317,10 +317,20 @@ module.exports = function (grunt) {
   grunt.registerTask('minify', ['uglify', 'sass:dist']);
   grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']);
 
-  grunt.registerTask('ci', [
-    'compile', 'connect:tests',
-    'saucelabs-qunit', 'qunit', 'jshint'
-  ]);
+  var ciTasks = [];
+
+  ciTasks.push('compile')
+  ciTasks.push('connect:tests');
+
+  // Can't run Sauce Labs tests in pull requests
+  if (process.env.TRAVIS_PULL_REQUEST == null) {
+    ciTasks.push('saucelabs-qunit');
+  }
+
+  ciTasks.push('qunit');
+  ciTasks.push('jshint');
+
+  grunt.registerTask('ci', ciTasks);
 
   grunt.registerTask('docs', ['symlink:docs', 'jekyll:serve']);