Skip to content

Commit

Permalink
add pipeline script
Browse files Browse the repository at this point in the history
  • Loading branch information
oathdruid committed Jun 11, 2024
1 parent 6e72d08 commit e852451
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/filter_lcov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -ex

grep -Pn 'BABYLON_LOG\(.*\)' src/ -R | awk -F: '{print $1":"$2}' > ignore_branches

awk -F: '
ARGIND == 1 {skip_lines[$1] = skip_lines[$1]""$2","}
ARGIND == 2 {
skip = 0;
}
ARGIND == 2 && $1 == "SF" {
n = split(skip_lines[$2], arr, ",");
delete skip_line_set;
for (i = 1; i < n; ++i) {
skip_line_set[arr[i]];
}
skip_brf = 0;
skip_brh = 0;
}
ARGIND == 2 && $1 == "BRDA" {
split($2, arr, ",");
if (arr[1] in skip_line_set) {
skip = 1;
skip_brf++;
if (arr[4] > 0) {
skip_brh++;
}
}
}
ARGIND == 2 && $1 == "BRF" && skip_brf {
skip = 1;
print $1":"$2-skip_brf
}
ARGIND == 2 && $1 == "BRH" && skip_brh {
skip = 1;
print $1":"$2-skip_brh
}
ARGIND == 2 && !skip {
print
}
' ignore_branches bazel-out/_coverage/_coverage_report.dat > bazel-out/_coverage/_coverage_report.lcov

0 comments on commit e852451

Please sign in to comment.