From 07553034de5bd9ffa89df303bf789664f9cb8ed8 Mon Sep 17 00:00:00 2001 From: genotrance Date: Sat, 2 Feb 2019 06:26:32 -0600 Subject: [PATCH] Enable Travis folding in winrelease (#10528) --- koch.nim | 16 ++++++++++------ tools/kochdocs.nim | 17 +++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/koch.nim b/koch.nim index 89ee28d5a..6b799449e 100644 --- a/koch.nim +++ b/koch.nim @@ -373,9 +373,10 @@ proc winReleaseArch(arch: string) = withMingw r"..\mingw" & arch & r"\bin": # Rebuilding koch is necessary because it uses its pointer size to # determine which mingw link to put in the NSIS installer. - nimexec "c --cpu:$# koch" % cpu - kochExec "boot -d:release --cpu:$#" % cpu - kochExec "--latest zip -d:release" + inFold "winrelease koch": + nimexec "c --cpu:$# koch" % cpu + kochExecFold("winrelease boot", "boot -d:release --cpu:$#" % cpu) + kochExecFold("winrelease zip", "--latest zip -d:release") overwriteFile r"build\nim-$#.zip" % VersionAsString, r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch] @@ -384,13 +385,16 @@ proc winRelease*() = # anymore! # Build -docs file: when true: - buildDocs(gaCode) + inFold "winrelease buildDocs": + buildDocs(gaCode) withDir "web/upload/" & VersionAsString: - exec "7z a -tzip docs-$#.zip *.html" % VersionAsString + inFold "winrelease zipdocs": + exec "7z a -tzip docs-$#.zip *.html" % VersionAsString overwriteFile "web/upload/$1/docs-$1.zip" % VersionAsString, "web/upload/download/docs-$1.zip" % VersionAsString when true: - csource("-d:release") + inFold "winrelease csource": + csource("-d:release") when sizeof(pointer) == 4: winReleaseArch "32" when sizeof(pointer) == 8: diff --git a/tools/kochdocs.nim b/tools/kochdocs.nim index c0e7ce66b..e13ad3501 100644 --- a/tools/kochdocs.nim +++ b/tools/kochdocs.nim @@ -25,7 +25,6 @@ proc findNim*(): string = # assume there is a symlink to the exe or something: return nim - proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") = let prevPath = getEnv("PATH") if additionalPath.len > 0: @@ -38,14 +37,20 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") = if execShellCmd(cmd) != 0: quit("FAILURE", errorcode) putEnv("PATH", prevPath) +template inFold*(desc, body) = + if existsEnv("TRAVIS"): + echo "travis_fold:start:" & desc.replace(" ", "_") + + body + + if existsEnv("TRAVIS"): + echo "travis_fold:end:" & desc.replace(" ", "_") + proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath = "") = ## Execute shell command. Add log folding on Travis CI. # https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 - if existsEnv("TRAVIS"): - echo "travis_fold:start:" & desc.replace(" ", "_") - exec(cmd, errorcode, additionalPath) - if existsEnv("TRAVIS"): - echo "travis_fold:end:" & desc.replace(" ", "_") + inFold(desc): + exec(cmd, errorcode, additionalPath) proc execCleanPath*(cmd: string, additionalPath = ""; errorcode: int = QuitFailure) =