Skip to content

Commit

Permalink
switch to codecov.io
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 14, 2015
1 parent 82c3127 commit 509f381
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
18 changes: 18 additions & 0 deletions build/grunt-tasks/codecov.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function (grunt) {

grunt.registerTask('codecov', function () {
var done = this.async()
var sendToCodeCov = require('codecov.io/lib/sendToCodeCov.io.js')
var coverage = require('fs').readFileSync('coverage/lcov.info', 'utf-8')
sendToCodeCov(coverage, function (err) {
if (err) {
console.log("error sending to codecov.io: ", err, err.stack);
if (/non-success response/.test(err.message)){
console.log("detail: ", err.detail);
}
}
done()
})
})

}
11 changes: 3 additions & 8 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,10 @@ module.exports = function (grunt) {
sauce3: {
options: sauceConfig.batch3
}
},

coveralls: {
cover: {
src: 'coverage/lcov.info'
}
}

})

// load npm tasks
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-karma')
Expand All @@ -86,14 +80,15 @@ module.exports = function (grunt) {
// load custom tasks
require('./build/grunt-tasks/build')(grunt)
require('./build/grunt-tasks/casper')(grunt)
require('./build/grunt-tasks/codecov')(grunt)
require('./build/grunt-tasks/release')(grunt)

// register composite tasks
grunt.registerTask('unit', ['karma:browsers'])
grunt.registerTask('cover', ['karma:coverage'])
grunt.registerTask('test', ['unit', 'cover', 'casper'])
grunt.registerTask('sauce', ['karma:sauce1', 'karma:sauce2', 'karma:sauce3'])
grunt.registerTask('ci', ['jshint', 'cover', /*'coveralls',*/ 'build', 'casper', 'sauce'])
grunt.registerTask('ci', ['jshint', 'cover', 'codecov', 'build', 'casper', 'sauce'])
grunt.registerTask('default', ['jshint', 'build', 'test'])

grunt.registerTask('debug', ['coveralls', 'build'])
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
},
"devDependencies": {
"casperjs": "^1.1.0-beta3",
"codecov.io": "^0.1.2",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"grunt-coveralls": "^1.0.0",
"grunt-karma": "^0.8.3",
"jshint-stylish": "^0.3.0",
"karma": "^0.12.31",
Expand Down

0 comments on commit 509f381

Please sign in to comment.