Switch to codecov, also report on moor_generator

This commit is contained in:
Simon Binder 2019-03-23 11:32:31 +01:00
parent aa6582ae79
commit 828ac8c23f
No known key found for this signature in database
GPG Key ID: B807FDF954BA00CF
3 changed files with 29 additions and 10 deletions

View File

@ -6,6 +6,8 @@ import 'package:grinder/grinder_sdk.dart';
import 'package:coverage/coverage.dart';
import 'package:path/path.dart';
import 'format_coverage.dart' as fc;
const int _vmPort = 9876;
Future<void> main(List<String> args) async {
@ -31,13 +33,5 @@ Future<void> main(List<String> args) async {
print('coverage collected - formatting as lcov');
print('formatting to .lcov format');
await Pub.runAsync('coverage:format_coverage', arguments: [
'--lcov',
'--packages=.packages',
'--report-on=lib',
'-i',
'coverage.json',
'-o',
'lcov.info'
]);
await fc.main();
}

View File

@ -0,0 +1,25 @@
import 'dart:io';
import 'package:coverage/coverage.dart';
Future main() async {
Directory.current = Directory.current.parent;
final resolver = Resolver(
packagesPath: 'moor/.packages',
);
final coverage = await parseCoverage([File('moor/coverage.json')], 1);
// report coverage for the moor and moor_generator package
final lcov = await LcovFormatter(
resolver,
reportOn: [
'moor/lib/',
'moor_generator/lib',
],
basePath: '.'
).format(coverage);
File('moor/lcov.info').writeAsStringSync(lcov);
}

View File

@ -2,5 +2,5 @@
if [ "$PKG" == "moor" ]; then
pushd moor
pub run coveralls lcov.info
bash <(curl -s https://codecov.io/bash) -f lcov.info
fi