Skip to content

Commit

Permalink
switched to codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
HelpfulScripts committed Apr 13, 2020
1 parent ae8908c commit 925f162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .codecov.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"token": "ec8299ff-eca6-4b71-9da0-12efcb724143"
}
23 changes: 12 additions & 11 deletions sharedGruntConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ module.exports = (grunt, dir, dependencies, type, lib) => {
// grunt.registerTask('build-spec', ['tslint:spec', 'ts:test']);
grunt.registerTask('build-base', ['clean:dist', 'clean:docs', 'build-html', 'build-css', 'copy:bin', 'copy:example', 'build-js']);
switch(type) {
case 'node':grunt.registerTask('buildMin', ['build-base', 'doc', 'test', 'coverageReport']);
case 'node':grunt.registerTask('buildMin', ['build-base', 'doc', 'test']);
grunt.registerTask('buildDev', ['build-base']);
break;
case 'lib': grunt.registerTask('buildMin', ['build-base', 'webpack:appDev', 'webpack:appProd', 'doc', 'test', 'coverageReport']);
case 'lib': grunt.registerTask('buildMin', ['build-base', 'webpack:appDev', 'webpack:appProd', 'doc', 'test']);
grunt.registerTask('buildDev', ['build-base', 'webpack:appDev']);
break;
default: grunt.registerTask('buildMin', ['build-base', 'webpack:appDev', 'webpack:appProd', 'doc', 'test', 'coverageReport']);
default: grunt.registerTask('buildMin', ['build-base', 'webpack:appDev', 'webpack:appProd', 'doc', 'test']);
grunt.registerTask('buildDev', ['build-base', 'webpack:appDev']);
}

Expand All @@ -82,7 +82,7 @@ module.exports = (grunt, dir, dependencies, type, lib) => {
grunt.registerTask('dev', ['buildDev', 'stage']);
grunt.registerTask('product', ['buildMin', 'stage']);
// grunt.registerTask('travis', ['build-base', (type === 'node')?'':'webpack:appProd', 'test']); // exlude node-apps from webPack to avoid webpack error
grunt.registerTask('travis', ['build-base', 'test', 'coverageReport']); // exlude node-apps from webPack to avoid webpack error
grunt.registerTask('travis', ['build-base', 'test', 'coverageReport']);
grunt.registerTask('help', ['h']);

grunt.registerMultiTask('sourceCode', translateSourcesToHTML);
Expand Down Expand Up @@ -419,13 +419,14 @@ module.exports = (grunt, dir, dependencies, type, lib) => {

function codecov() {
const cp = require('child_process');
const codecov = require('./.codecov.json');
if (codecov) {
const token = codecov.token;
const result = cp.spawnSync(`bash <(curl -s https://codecov.io/bash) -t ${token}`, {stdio: 'inherit', shell:'/bin/bash'});
console.log(`status: ${result.status}\noutput: ${result.stdout}\nerror: ${result.stderr}`);
if (result.stderr) { console.log(`error: ${result.stderr}`); }
}
try {
const codecov = require('./.codecov.json');
if (codecov) {
const result = cp.spawnSync(`bash <(curl -s https://codecov.io/bash) -t ${codecov.token}`, {stdio: 'inherit', shell:'/bin/bash'});
console.log(`status: ${result.status}`);
if (result.stderr) { console.log(`error: ${result.stderr}`); }
}
} catch(e) {}
}

function writeIndexJson() {
Expand Down

0 comments on commit 925f162

Please sign in to comment.