2019-11-11 21:43:40 +00:00
|
|
|
def runStages() {
|
2019-12-03 14:02:38 +00:00
|
|
|
try {
|
|
|
|
stage("Clone") {
|
2020-04-19 11:36:11 +00:00
|
|
|
sh "rm -rf *"
|
2019-12-03 14:02:38 +00:00
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
|
2019-12-03 17:57:05 +00:00
|
|
|
cache(maxCacheSize: 250, caches: [
|
|
|
|
[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/vendor/nimbus-build-system/vendor/Nim/bin"],
|
|
|
|
[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/jsonTestsCache"]
|
|
|
|
]) {
|
2019-12-03 14:02:38 +00:00
|
|
|
stage("Build") {
|
|
|
|
sh "make -j${env.NPROC} update" /* to allow a newer Nim version to be detected */
|
|
|
|
sh "make -j${env.NPROC} deps" /* to allow the following parallel stages */
|
2020-04-19 10:41:40 +00:00
|
|
|
sh "V=1 ./scripts/setup_official_tests.sh jsonTestsCache"
|
2019-11-11 21:43:40 +00:00
|
|
|
}
|
2019-12-03 17:57:05 +00:00
|
|
|
}
|
2019-12-03 14:02:38 +00:00
|
|
|
|
|
|
|
stage("Test") {
|
|
|
|
parallel(
|
|
|
|
"tools": {
|
|
|
|
stage("Tools") {
|
2020-02-20 15:17:55 +00:00
|
|
|
sh "make -j${env.NPROC}"
|
2020-03-22 20:54:47 +00:00
|
|
|
sh "make -j${env.NPROC} LOG_LEVEL=TRACE NIMFLAGS='-d:testnet_servers_image'"
|
2020-01-13 19:58:12 +00:00
|
|
|
}
|
|
|
|
},
|
2019-12-03 14:02:38 +00:00
|
|
|
"test suite": {
|
|
|
|
stage("Test suite") {
|
|
|
|
sh "make -j${env.NPROC} DISABLE_TEST_FIXTURES_SCRIPT=1 test"
|
|
|
|
}
|
2020-03-10 17:01:04 +00:00
|
|
|
if ("${NODE_NAME}" ==~ /linux.*/) {
|
|
|
|
stage("testnet finalization") {
|
2020-04-02 08:58:03 +00:00
|
|
|
sh "./scripts/launch_local_testnet.sh --testnet 0 --nodes 4 --log-level INFO --disable-htop -- --verify-finalization --stop-at-epoch=5"
|
|
|
|
sh "./scripts/launch_local_testnet.sh --testnet 1 --nodes 4 --log-level INFO --disable-htop -- --verify-finalization --stop-at-epoch=5"
|
2020-03-10 17:01:04 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-03 14:02:38 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
} catch(e) {
|
|
|
|
echo "'${env.STAGE_NAME}' stage failed"
|
2019-12-03 17:57:05 +00:00
|
|
|
// we need to rethrow the exception here
|
2019-12-03 14:02:38 +00:00
|
|
|
throw e
|
|
|
|
} finally {
|
2020-04-19 11:17:02 +00:00
|
|
|
cleanWs(disableDeferredWipeout: true, deleteDirs: true)
|
2019-11-11 21:16:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-11 21:43:40 +00:00
|
|
|
parallel(
|
|
|
|
"Linux": {
|
|
|
|
node("linux") {
|
|
|
|
withEnv(["NPROC=${sh(returnStdout: true, script: 'nproc').trim()}"]) {
|
|
|
|
runStages()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"macOS": {
|
|
|
|
node("macos") {
|
|
|
|
withEnv(["NPROC=${sh(returnStdout: true, script: 'sysctl -n hw.logicalcpu').trim()}"]) {
|
|
|
|
runStages()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|