Skip to content

Commit 812bc0b

Browse files
KrinkleFagnerMartinsBrack
authored andcommitted
travis: Don't run grunt-saucelabs for pull requests
Fixes constant build failures because Travis' secure environment variables are not (and should not) be exposed for pull requests. Quoting node version number because 0.10 === 0.1, 0.10 === 0.100 (floating numbers, yay). ref carhartl/jquery-cookie#312, Closes gh-1.
1 parent f9a8b77 commit 812bc0b

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎.travis.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
language: node_js
22
node_js:
3-
- 0.10
3+
- '0.10'
44
before_script:
55
- npm install -g grunt-cli
6-
script: grunt ci --verbose
6+
# Only use grunt-ci for commits pushed to this repo. Fall back to regular test
7+
# for pull requests (as secure variables won't be exposed there).
8+
script: |
9+
test $SAUCE_ACCESS_KEY == 'false' && grunt ci --verbose || npm test
710
env:
811
# Encrypted SAUCE_USERNAME and SAUCE_ACCESS_KEY used by travis
912
global:

‎Gruntfile.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ module.exports = function (grunt) {
163163
}
164164
}
165165

166-
grunt.registerTask('default', ['jshint', 'qunit', 'uglify', 'compare_size']);
167166
grunt.registerTask('saucelabs', ['connect:saucelabs', 'saucelabs-qunit']);
168-
grunt.registerTask('ci', ['jshint', 'qunit', 'saucelabs']);
167+
grunt.registerTask('test', ['jshint', 'qunit']);
168+
169+
grunt.registerTask('dev', ['test', 'uglify', 'compare_size']);
170+
grunt.registerTask('ci', ['test', 'saucelabs']);
171+
172+
grunt.registerTask('default', 'dev');
169173
};

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "test"
88
},
99
"scripts": {
10-
"test": "grunt"
10+
"test": "grunt test"
1111
},
1212
"repository": {
1313
"type": "git",

0 commit comments

Comments
 (0)