mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 22:06:21 +00:00
Jakub
c33989e490
Changes: - Name local testnet output folders same as the `make` taget. - Move both `Jenkinsfile`s to `ci` folder to avoid cluttering repo root. - Separate builds by platform so logs from macos and linux hosts don't get mixed. - Detect platform and architecture from Jenkins Job path to use one Jenkinsfile. - Divide shell commands into as many stages as possible to make debugging easier. - Generalize running testnets via a `launchLocalTestnet()` Groovy method. - Handle uploading of results of running testnets stage-by-stage basis. - Use `catchError()` to upload test results while marking job as failed. - Abort previously started PR build jobs usin `disableConcurrentBuilds()`. - Throttle jobs using the new `throttleJobProperty()` function. Builds: - https://ci.status.im/job/nimbus/job/nimbus-eth2/job/platforms/job/linux/job/x86_64/ - https://ci.status.im/job/nimbus/job/nimbus-eth2/job/platforms/job/macos/job/x86_64/ - https://ci.status.im/job/nimbus/job/nimbus-eth2/job/platforms/job/macos/job/aarch64/ Signed-off-by: Jakub Sokołowski <jakub@status.im>
46 lines
1.3 KiB
Plaintext
46 lines
1.3 KiB
Plaintext
// https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started
|
|
// We should only abort older jobs in PR branches, so we have a nice CI history in "master" and "devel".
|
|
if (env.BRANCH_NAME != "master" && env.BRANCH_NAME != "devel") {
|
|
def buildNumber = env.BUILD_NUMBER as int
|
|
if (buildNumber > 1) {
|
|
milestone(buildNumber - 1)
|
|
}
|
|
milestone(buildNumber)
|
|
}
|
|
|
|
node("metal") {
|
|
withEnv(["NPROC=${sh(returnStdout: true, script: 'nproc').trim()}"]) {
|
|
try {
|
|
stage("Clone") {
|
|
/* source code checkout */
|
|
checkout scm
|
|
/* we need to update the submodules before caching kicks in */
|
|
sh "git submodule update --init --recursive"
|
|
}
|
|
|
|
stage("Build") {
|
|
sh """#!/bin/bash
|
|
set -e
|
|
make -j${env.NPROC} update # to allow a newer Nim version to be detected
|
|
"""
|
|
}
|
|
|
|
stage("Benchmark") {
|
|
sh """#!/bin/bash
|
|
set -e
|
|
git clone https://github.com/status-im/nimbus-benchmarking.git
|
|
./nimbus-benchmarking/run_nbc_benchmarks.sh
|
|
"""
|
|
benchmark(altInputSchema: "", altInputSchemaLocation: "", inputLocation: "results/*/result.json", schemaSelection: "defaultSchema", truncateStrings: true)
|
|
}
|
|
} catch(e) {
|
|
// we need to rethrow the exception here
|
|
throw e
|
|
} finally {
|
|
// clean the workspace
|
|
cleanWs(disableDeferredWipeout: true, deleteDirs: true)
|
|
}
|
|
}
|
|
}
|
|
|