Skip to content

Commit

Permalink
support [nimDocOnly]
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Apr 12, 2020
1 parent c47fd59 commit 10d49ff
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
23 changes: 22 additions & 1 deletion koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,18 @@ proc runCI(cmd: string) =
doAssert cmd.len == 0, cmd # avoid silently ignoring
echo "runCI: ", cmd
echo hostInfo()
if isAzureCI(): installNode()
if isAzureCI(): installNode()

template runDocs() =
when defined(posix):
kochExecFold("Docs", "docs --git.commit:devel")

if isNimDocOnly():
echo "isNimDocOnly: true"
runDocs()
echo "isNimDocOnly: done"
return

# boot without -d:nimHasLibFFI to make sure this still works
kochExecFold("Boot in release mode", "boot -d:release")

Expand Down Expand Up @@ -547,6 +558,16 @@ proc runCI(cmd: string) =
when defined(posix):
execFold("Run nimsuggest tests", "nim c -r nimsuggest/tester")

when false: # disabled from runCI in #13803
## remaining actions
runDocs()
when defined(posix):
kochExecFold("C sources", "csource")
elif defined(windows):
when false:
kochExec "csource"
kochExec "zip"

proc pushCsources() =
if not dirExists("../csources/.git"):
quit "[Error] no csources git repository found"
Expand Down
24 changes: 21 additions & 3 deletions tools/continuous_integration.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
## See also: testament/azure.nim

import os, osproc, strformat
import os, osproc, strformat, strutils
import "."/azure_common

export isAzureCI
Expand All @@ -22,6 +22,22 @@ proc tryRunCmd(cmd: string): bool =
echo "tryRunCmd: " & cmd
execShellCmd(cmd) == 0

proc gitLogPretty(): string =
## returns last 2 entries
runCmd "pwd && git rev-parse --show-toplevel"
runCmd "git log --no-merges -1 --pretty=oneline"
runCmd "git log --no-merges -2 --pretty=oneline"
let cmd = "git log --no-merges -1 --pretty=oneline"
echo cmd
let (outp, errC) = execCmdEx(cmd)
doAssert errC == 0, $outp
echo ("gitLogPretty", outp, errC)
outp

proc isNimDocOnly*(): bool =
# TODO: support windows
"[nimDocOnly]" in gitLogPretty()

proc installNode*() =
echo "installNode"
when defined(osx):
Expand All @@ -30,8 +46,10 @@ proc installNode*() =
runCmd "brew link --overwrite node"
elif defined(linux):
# https://linuxize.com/post/how-to-install-node-js-on-ubuntu-18.04/
runCmd "curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -"
runCmd "sudo apt install -yqq nodejs"
template suppress(a): untyped =
a & " > /dev/null 2>&1"
runCmd "curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -".suppress
runCmd "sudo apt install -yqq nodejs".suppress
runCmd "nodejs --version"
elif defined(windows):
# should've be installed via azure-pipelines.yml, but could do it here too
Expand Down

0 comments on commit 10d49ff

Please sign in to comment.