Skip to content

Commit

Permalink
Update coverage workflow (#7430)
Browse files Browse the repository at this point in the history
* Trigger a workflow when a pr is created.

* Remove redundant comments and update variables.
  • Loading branch information
granluo authored Feb 2, 2021
1 parent f3bb73f commit 93574c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: test_coverage

on:
pull_request:
# open will be triggered when a pull request is created.
# synchronize will be triggered when a pull request has new commits.
# closed will be triggered when a pull request is closed.
types: [synchronize, closed]
types: [open, synchronize, closed]

jobs:
check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extension CoverageReportRequestData {
// FirebaseDatabase-ios-FirebaseCore.framework, a regex pattern will be
// used to exclude results that are not related in terms of the target names.
let sdk_name = resultBundle.components(separatedBy: "-")[0]
let range = NSRange(location: 0, length: sdk_name.utf16.count)
let range = NSRange(location: 0, length: target.name.utf16.count)
let sdk_related_coverage_file_pattern = try! NSRegularExpression(
pattern: ".*\(sdk_name).*",
options: NSRegularExpression.Options(rawValue: 0)
Expand All @@ -78,8 +78,6 @@ extension CoverageReportRequestData {
value: target.lineCoverage))
for file in target.files {
results
// .append(FileCoverage(sdk: resultBundle + "-" + target.name + "(Coverage:\(String(format:"%.2f%%", target.lineCoverage*100)))", type: file.name,
// value: file.lineCoverage))
.append(FileCoverage(sdk: resultBundle + "-" + target.name, type: file.name,
value: file.lineCoverage))
results
Expand Down

0 comments on commit 93574c5

Please sign in to comment.