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 d0993e0
Show file tree
Hide file tree
Showing 2 changed files with 23 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
20 changes: 20 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 Down Expand Up @@ -281,6 +285,22 @@ 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(finalMdPath, "# Coverage report\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 d0993e0

Please sign in to comment.