mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-02 03:57:36 +08:00
switch to codecov.io
This commit is contained in:
parent
82c3127813
commit
509f381cb8
18
build/grunt-tasks/codecov.js
Normal file
18
build/grunt-tasks/codecov.js
Normal file
@ -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
gruntfile.js
11
gruntfile.js
@ -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')
|
||||
@ -86,6 +80,7 @@ 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
|
||||
@ -93,7 +88,7 @@ module.exports = function (grunt) {
|
||||
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'])
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user