| #!/usr/bin/env groovy |
| //------------------------------------------------------------------------------- |
| // Copyright (c) 2020, 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, ignore the failure at this moment |
| // The cpp check and check patch may fail for current checking policy, or |
| // fail by the TF-M coding not align with Linux style completely. |
| if (status < 0 ) { |
| echo "Ignore the static checks failure." |
| } |
| } |