action.nim 650 B

123456789101112131415161718192021222324252627
  1. import std/[strutils, os, osproc, parseutils, strformat]
  2. proc main() =
  3. var msg = ""
  4. const cmd = "./koch boot --gc:orc -d:release"
  5. let (output, exitCode) = execCmdEx(cmd)
  6. doAssert exitCode == 0, output
  7. let start = rfind(output, "Hint: mm")
  8. doAssert parseUntil(output, msg, "; proj", start) > 0, output
  9. let (commitHash, _) = execCmdEx("""git log --format="%H" -n 1""")
  10. let welcomeMessage = fmt"""Thanks for your hard work on this PR!
  11. The lines below are statistics of the Nim compiler built from {commitHash}
  12. {msg}
  13. """
  14. createDir "ci/nimcache"
  15. writeFile "ci/nimcache/results.txt", welcomeMessage
  16. when isMainModule:
  17. main()