nimbus-eth2/Jenkinsfile

61 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-11-11 21:43:40 +00:00
def runStages() {
try {
stage("Clone") {
checkout scm
sh "make build-system-checks || true"
}
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}/vendor/go/bin"],
[$class: "ArbitraryFileCache", excludes: "", includes: "**/*", path: "${WORKSPACE}/jsonTestsCache"]
]) {
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 */
sh "scripts/setup_official_tests.sh jsonTestsCache"
2019-11-11 21:43:40 +00:00
}
2019-12-03 17:57:05 +00:00
}
stage("Test") {
parallel(
"tools": {
stage("Tools") {
sh "make -j${env.NPROC}"
2020-02-08 22:20:45 +00:00
sh "make -j${env.NPROC} NIMFLAGS='-d:NETWORK_TYPE=libp2p -d:testnet_servers_image'"
}
},
"test suite": {
stage("Test suite") {
sh "make -j${env.NPROC} DISABLE_TEST_FIXTURES_SCRIPT=1 test"
}
}
)
}
} catch(e) {
echo "'${env.STAGE_NAME}' stage failed"
2019-12-03 17:57:05 +00:00
// we need to rethrow the exception here
throw e
} finally {
cleanWs()
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()
}
}
}
)