Skip to content

Commit

Permalink
codecov fixed?
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Jul 19, 2024
1 parent 52272a4 commit 93f8c2d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mono_repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ coverage_service:
# https://coveralls.io/ - the default
- coveralls
# https://codecov.io/ – the other option
# NOTE: `CODECOV_TOKEN` must be populated in your GitHub actions secrets
- codecov
```
Expand Down
49 changes: 25 additions & 24 deletions mono_repo/lib/src/task_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,31 @@ class _TestWithCoverageTask extends TaskType {
String packageDirectory,
BasicConfiguration config,
RootConfig rootConfig,
) {
) sync* {
final countString = (_count++).toString().padLeft(2, '0');
return [
if (config.coverageProcessors.contains(CoverageProcessor.coveralls))
ActionInfo.coveralls.usage(
name: 'Upload coverage to Coveralls',
withContent: {
// https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
'github-token': r'${{ secrets.GITHUB_TOKEN }}',
'path-to-lcov': '$packageDirectory/coverage/lcov.info',
'flag-name': 'coverage_$countString',
'parallel': true,
},
versionOverrides: rootConfig.existingActionVersions,
),
if (config.coverageProcessors.contains(CoverageProcessor.codecov))
ActionInfo.codecov.usage(
withContent: {
'files': '$packageDirectory/coverage/lcov.info',
'fail_ci_if_error': true,
'name': 'coverage_$countString',
},
versionOverrides: rootConfig.existingActionVersions,
),
];
if (config.coverageProcessors.contains(CoverageProcessor.coveralls)) {
yield ActionInfo.coveralls.usage(
name: 'Upload coverage to Coveralls',
withContent: {
// https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
'github-token': r'${{ secrets.GITHUB_TOKEN }}',
'path-to-lcov': '$packageDirectory/coverage/lcov.info',
'flag-name': 'coverage_$countString',
'parallel': true,
},
versionOverrides: rootConfig.existingActionVersions,
);
}
if (config.coverageProcessors.contains(CoverageProcessor.codecov)) {
yield ActionInfo.codecov.usage(
withContent: {
'files': '$packageDirectory/coverage/lcov.info',
'fail_ci_if_error': true,
'name': 'coverage_$countString',
'token': r'${{ secrets.CODECOV_TOKEN }}'
},
versionOverrides: rootConfig.existingActionVersions,
);
}
}
}

0 comments on commit 93f8c2d

Please sign in to comment.