Skip to content

Commit

Permalink
Add color to the history plots in the rendered HTML (#175)
Browse files Browse the repository at this point in the history
Co-authored-by: Lilith Hafner <Lilith.Hafner@gmail.com>
  • Loading branch information
LilithHafner and Lilith Hafner authored Aug 9, 2023
1 parent cee3e9b commit 0afe366
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/jobs/PkgEvalJob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,10 @@ end
# PkgEvalJob Reporting #
########################

const COLOR_MAP = map(('' => "#60F", '' => "#F03", '' => "#FF0", '' => "#666", '' => "#0F0")) do (char, color)
Regex("($char+)") => SubstitutionString("<span style=\"color: $color\">\\1</span>")
end

# report job results back to GitHub
function report(job::PkgEvalJob, results)
node = myid()
Expand Down Expand Up @@ -789,6 +793,7 @@ function report(job::PkgEvalJob, results)
<body>$body</body>
</html>
"""
report_html = replace(report_html, COLOR_MAP...)
try
S3.put_object("$(cfg.bucket)/pkgeval/$(jobdirname(job))",
"report.html",
Expand Down

0 comments on commit 0afe366

Please sign in to comment.