2023-09-18 18:24:13 +00:00
|
|
|
/* beacon_chain
|
|
|
|
* Copyright (c) 2022-2023 Status Research & Development GmbH
|
|
|
|
* Licensed and distributed under either of
|
|
|
|
* * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
* * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
* at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
*/
|
|
|
|
|
2020-08-26 15:31:46 +00:00
|
|
|
// https://stackoverflow.com/questions/40760716/jenkins-abort-running-build-if-new-one-is-started
|
2020-09-25 10:26:59 +00:00
|
|
|
// 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)
|
2020-08-26 15:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 */
|
2023-11-09 14:45:07 +00:00
|
|
|
sh "git -c lfs.fetchexclude=/public-keys/all.txt,/custom_config_data/genesis.ssz submodule update --init --recursive"
|
2020-08-26 15:31:46 +00:00
|
|
|
}
|
|
|
|
|
2022-04-15 09:07:14 +00:00
|
|
|
stage("Build") {
|
|
|
|
sh """#!/bin/bash
|
|
|
|
set -e
|
|
|
|
make -j${env.NPROC} update # to allow a newer Nim version to be detected
|
|
|
|
"""
|
2020-08-26 15:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|