add duration to result reporting

This commit is contained in:
Daylin Morgan 2024-11-13 12:06:46 -06:00
parent 56a1ae6931
commit cf24473272
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -304,16 +304,16 @@ proc reportResults(results: seq[(OizysDerivation, BuildResult)]) =
fmt"| {name} | `{hash}` | " & ( fmt"| {name} | `{hash}` | " & (
if res.successful: ":white_check_mark:" if res.successful: ":white_check_mark:"
else: ":x:" else: ":x:"
) & " |" ) & " |" & $(res.duration)
) )
let summaryFilePath = getEnv("GITHUB_STEP_SUMMARY") let summaryFilePath = getEnv("GITHUB_STEP_SUMMARY")
if summaryFilePath == "": fatalQuit "no github step summary found" if summaryFilePath == "": fatalQuit "no github step summary found"
let output = open(summaryFilePath,fmAppend) let output = open(summaryFilePath, fmAppend)
output.writeLine("| derivation | hash | build successful |\n|---|---|---|") output.writeLine "| derivation | hash | build | time |"
output.writeLine(rows.join("\n")) output.writeLine "\n|---|---|---|---|"
output.writeLine rows.join("\n")
close output close output
proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int) = proc nixBuildWithCache*(name: string, rest:seq[string], service: string, jobs: int) =
## build individual derivations not cached and push to cache ## build individual derivations not cached and push to cache
if findExe(service) == "": fatalQuit fmt"is {service} installed?" if findExe(service) == "": fatalQuit fmt"is {service} installed?"