Created
May 22, 2023 16:29
-
-
Save ajilo297/0a99d43a16f1365d1d4e6511f4f5bd5c to your computer and use it in GitHub Desktop.
Combine coverage for a melos monorepo for flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
escapedPath="$(echo `pwd` | sed 's/\//\\\//g')" | |
if grep flutter pubspec.yaml > /dev/null; then | |
if [ -d "coverage" ]; then | |
# combine line coverage info from package tests to a common file | |
if [ ! -d "$MELOS_ROOT_PATH/coverage_report" ]; then | |
mkdir "$MELOS_ROOT_PATH/coverage_report" | |
fi | |
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage_report/lcov.info" | |
rm -rf "coverage" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment