Improve Travis CI folding (#10473)

This commit is contained in:
Federico Ceratto 2019-01-28 16:33:35 +00:00 • committed by Andreas Rumpf
commit aa0a9dd78c
3 changed files with 13 additions and 6 deletions

View file

@ -45,7 +45,9 @@ before_script:
- set +e # prevents breaking after_failure - set +e # prevents breaking after_failure
script: script:
- echo "travis_fold:start:nim_c_koch"
- nim c koch - nim c koch
- echo "travis_fold:end:nim_c_koch"
- ./koch runCI - ./koch runCI
before_deploy: before_deploy:

View file

@ -163,7 +163,7 @@ proc bundleNimsuggest() =
nimCompile("nimsuggest/nimsuggest.nim", options = "-d:release") nimCompile("nimsuggest/nimsuggest.nim", options = "-d:release")
proc buildVccTool() = proc buildVccTool() =
nimCompile("tools/vccexe/vccexe.nim") nimCompileFold("Compile Vcc", "tools/vccexe/vccexe.nim")
proc bundleWinTools() = proc bundleWinTools() =
# TODO: consider building under `bin` instead of `.` # TODO: consider building under `bin` instead of `.`
@ -208,10 +208,10 @@ proc buildTool(toolname, args: string) =
proc buildTools() = proc buildTools() =
bundleNimsuggest() bundleNimsuggest()
nimCompile("tools/nimgrep.nim", options = "-d:release") nimCompileFold("Compile nimgrep", "tools/nimgrep.nim", options = "-d:release")
when defined(windows): buildVccTool() when defined(windows): buildVccTool()
nimCompile("nimpretty/nimpretty.nim", options = "-d:release") nimCompileFold("Compile nimpretty", "nimpretty/nimpretty.nim", options = "-d:release")
nimCompile("tools/nimfind.nim", options = "-d:release") nimCompileFold("Compile nimfind", "tools/nimfind.nim", options = "-d:release")
proc nsis(latest: bool; args: string) = proc nsis(latest: bool; args: string) =
bundleNimbleExe(latest) bundleNimbleExe(latest)

View file

@ -42,10 +42,10 @@ proc execFold*(desc, cmd: string, errorcode: int = QuitFailure, additionalPath =
## Execute shell command. Add log folding on Travis CI. ## Execute shell command. Add log folding on Travis CI.
# https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 # https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719
if existsEnv("TRAVIS"): if existsEnv("TRAVIS"):
echo "travis_fold:start:" & desc.replace(" ", "") echo "travis_fold:start:" & desc.replace(" ", "_")
exec(cmd, errorcode, additionalPath) exec(cmd, errorcode, additionalPath)
if existsEnv("TRAVIS"): if existsEnv("TRAVIS"):
echo "travis_fold:end:" & desc.replace(" ", "") echo "travis_fold:end:" & desc.replace(" ", "_")
proc execCleanPath*(cmd: string, proc execCleanPath*(cmd: string,
additionalPath = ""; errorcode: int = QuitFailure) = additionalPath = ""; errorcode: int = QuitFailure) =
@ -69,6 +69,11 @@ proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") =
let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
exec cmd exec cmd
proc nimCompileFold*(desc, input: string, outputDir = "bin", mode = "c", options = "") =
let output = outputDir / input.splitFile.name.exe
let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
execFold(desc, cmd)
const const
pdf = """ pdf = """
doc/manual.rst doc/manual.rst