Skip to content

Commit

Permalink
[ci] add urg report to ci
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed Oct 5, 2024
1 parent f73b6f3 commit 1e6c232
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/vcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ jobs:
- name: "Print step summary"
run: |
nix run ".#ci-helper" -- postCI \
--urg-report-file-path ./urg-report.md \
--cycle-update-file-path ./cycle-update.md \
--failed-tests-file-path ./failed-tests.md \
--emu-type vcs
cat ./urg-report.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./cycle-update.md >> $GITHUB_STEP_SUMMARY
echo >> $GITHUB_STEP_SUMMARY
cat ./failed-tests.md >> $GITHUB_STEP_SUMMARY
Expand Down
24 changes: 24 additions & 0 deletions script/ci/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ object Main:
name = "cycle-update-file-path",
doc = "specify the cycle update markdown file output path"
) cycleUpdateFilePath: String,
@arg(
name = "urg-report-file-path",
doc = "specify the urg report markdown file output path"
) urgReportFilePath: Option[String],
@arg(
name = "emu-type",
doc = "Specify emulation type"
Expand All @@ -231,6 +235,9 @@ object Main:
"## Cycle Update\n"
)

if urgReportFilePath.nonEmpty then
os.write(os.Path(urgReportFilePath.get, os.pwd), "# Coverage report\n")

os.walk(os.pwd / ".github" / caseDir)
.filter(_.last == "default.json")
.foreach: file =>
Expand Down Expand Up @@ -281,6 +288,23 @@ object Main:
allCycleUpdates.mkString("\n") + "\n"
)

if urgReportFilePath.nonEmpty then
Logger.info("Filtering urg report")
val finalMdPath = os.Path(urgReportFilePath.get, os.pwd)
val urgAssertFile = emuResultPath / "urgReport" / "asserts.txt"
val heading = "^Summary for Cover Properties$".r
val coverSummaryStr =
os.read(urgAssertFile)
.lines()
.dropWhile(!heading.matches(_))
.takeWhile(_.distinct != "-")
.toArray
.mkString("\n")
os.write.append(finalMdPath, s"### Coverage for $config\n")
os.write.append(finalMdPath, "```text\n")
os.write.append(finalMdPath, coverSummaryStr)
os.write.append(finalMdPath, "\n```")

os.write.over(file, ujson.write(cycleRecord, indent = 2))
end postCI

Expand Down

0 comments on commit 1e6c232

Please sign in to comment.