blob: 95537a31f1c70f8cee698ce8305428300f10f9e7 [file] [log] [blame]
#!/usr/bin/env groovy
//-------------------------------------------------------------------------------
// Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//
//-------------------------------------------------------------------------------
def trigger(job_name) {
return {
def params = []
params += string(name: 'GERRIT_HOST', value: env.GERRIT_HOST ?: '')
params += string(name: 'GERRIT_BRANCH', value: env.GERRIT_BRANCH ?: '')
params += string(name: 'GERRIT_REFSPEC', value: env.GERRIT_REFSPEC ?: '')
params += string(name: 'GERRIT_CHANGE_NUMBER', value: env.GERRIT_CHANGE_NUMBER ?: '')
params += string(name: 'GERRIT_PATCHSET_REVISION', value: env.GERRIT_PATCHSET_REVISION ?: '')
params += string(name: 'MBEDTLS_VERSION', value: env.MBEDTLS_VERSION)
params += string(name: 'CODE_REPO', value: env.CODE_REPO)
build(job: job_name, parameters: params)
}
}
def status = 1
stage("Static Checks") {
def checks = [:]
checks["cppcheck"] = trigger("tf-m-cppcheck")
checks["checkpatch"] = trigger("tf-m-checkpatch")
checks["static-checks"] = trigger("tf-m-static-checks")
try {
parallel(checks)
} catch (Exception e) {
status = -1
echo "Failed static checks, continuing with build."
}
}
stage("Trigger Build") {
parallel(["build":trigger("tf-m-build-and-test")])
// If previously failed at static checks, mark this as a failure
if (status < 0 ) {
error("Failing due to failed static checks.")
}
}