mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Enable log folding in Travis CI (#10414)
Prevent log truncation in browsers
This commit is contained in:
committed by
Andreas Rumpf
parent
a6a014a859
commit
54fecdb8df
25
koch.nim
25
koch.nim
@@ -80,6 +80,9 @@ let kochExe* = when isMainModule: os.getAppFilename() # always correct when koch
|
||||
proc kochExec*(cmd: string) =
|
||||
exec kochExe.quoteShell & " " & cmd
|
||||
|
||||
proc kochExecFold*(desc, cmd: string) =
|
||||
execFold(desc, kochExe.quoteShell & " " & cmd)
|
||||
|
||||
template withDir(dir, body) =
|
||||
let old = getCurrentDir()
|
||||
try:
|
||||
@@ -453,11 +456,11 @@ proc runCI(cmd: string) =
|
||||
# note(@araq): Do not replace these commands with direct calls (eg boot())
|
||||
# as that would weaken our testing efforts.
|
||||
when defined(posix): # appveyor (on windows) didn't run this
|
||||
kochExec "boot"
|
||||
kochExec "boot -d:release"
|
||||
kochExecFold("Boot", "boot")
|
||||
kochExecFold("Boot in release mode", "boot -d:release")
|
||||
|
||||
## build nimble early on to enable remainder to depend on it if needed
|
||||
kochExec "nimble"
|
||||
kochExecFold("Build Nimble", "nimble")
|
||||
|
||||
when false:
|
||||
for pkg in "zip opengl sdl1 jester@#head niminst".split:
|
||||
@@ -466,23 +469,23 @@ proc runCI(cmd: string) =
|
||||
buildTools() # altenatively, kochExec "tools --toolsNoNimble"
|
||||
|
||||
## run tests
|
||||
exec "nim e tests/test_nimscript.nims"
|
||||
execFold("Test nimscript", "nim e tests/test_nimscript.nims")
|
||||
when defined(windows):
|
||||
# note: will be over-written below
|
||||
exec "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/tester"
|
||||
execFold("Compile tester", "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/tester")
|
||||
|
||||
# main bottleneck here
|
||||
exec "nim c -r -d:nimCoroutines testament/tester --pedantic all -d:nimCoroutines"
|
||||
execFold("Run tester", "nim c -r -d:nimCoroutines testament/tester --pedantic all -d:nimCoroutines")
|
||||
|
||||
exec "nim c -r nimdoc/tester"
|
||||
exec "nim c -r nimpretty/tester.nim"
|
||||
execFold("Run nimdoc tests", "nim c -r nimdoc/tester")
|
||||
execFold("Run nimpretty tests", "nim c -r nimpretty/tester.nim")
|
||||
when defined(posix):
|
||||
exec "nim c -r nimsuggest/tester"
|
||||
execFold("Run nimsuggest tests", "nim c -r nimsuggest/tester")
|
||||
|
||||
## remaining actions
|
||||
when defined(posix):
|
||||
kochExec "docs --git.commit:devel"
|
||||
kochExec "csource"
|
||||
kochExecFold("Docs", "docs --git.commit:devel")
|
||||
kochExecFold("C sources", "csource")
|
||||
elif defined(windows):
|
||||
when false:
|
||||
kochExec "csource"
|
||||
|
||||
@@ -38,6 +38,15 @@ proc exec*(cmd: string, errorcode: int = QuitFailure, additionalPath = "") =
|
||||
if execShellCmd(cmd) != 0: quit("FAILURE", errorcode)
|
||||
putEnv("PATH", prevPath)
|
||||
|
||||
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(" ", "")
|
||||
|
||||
proc execCleanPath*(cmd: string,
|
||||
additionalPath = ""; errorcode: int = QuitFailure) =
|
||||
# simulate a poor man's virtual environment
|
||||
|
||||
Reference in New Issue
Block a user