blob: 6ada310f23121fbbc6c285b1545e301e9e7fb841 [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +00001#!/usr/bin/env groovy
2//-------------------------------------------------------------------------------
3// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6//
7//-------------------------------------------------------------------------------
8
9
10def trigger(job_name) {
11 return {
12 def params = []
13 params += string(name: 'GERRIT_HOST', value: env.GERRIT_HOST ?: '')
14 params += string(name: 'GERRIT_BRANCH', value: env.GERRIT_BRANCH ?: '')
15 params += string(name: 'GERRIT_REFSPEC', value: env.GERRIT_REFSPEC ?: '')
16 params += string(name: 'GERRIT_CHANGE_NUMBER', value: env.GERRIT_CHANGE_NUMBER ?: '')
17 params += string(name: 'GERRIT_PATCHSET_REVISION', value: env.GERRIT_PATCHSET_REVISION ?: '')
18 params += string(name: 'CMSIS_VERSION', value: env.CMSIS_VERSION)
19 params += string(name: 'MBEDCRYPTO_VERSION', value: env.MBEDCRYPTO_VERSION)
Karl Zhang02d30352020-08-20 13:48:52 +080020 params += string(name: 'MBEDTLS_VERSION', value: env.MBEDTLS_VERSION)
Dean Birch62c4f082020-01-17 16:13:26 +000021 params += string(name: 'CODE_REPO', value: env.CODE_REPO)
22 build(job: job_name, parameters: params)
23 }
24}
25
Matthew Hartfb6fd362020-03-04 21:03:59 +000026def status = 1
27
Dean Birch62c4f082020-01-17 16:13:26 +000028stage("Static Checks") {
29 def checks = [:]
30 checks["cppcheck"] = trigger("tf-m-cppcheck")
31 checks["checkpatch"] = trigger("tf-m-checkpatch")
Matthew Hartfb6fd362020-03-04 21:03:59 +000032 try {
33 parallel(checks)
34 } catch (Exception e) {
35 status = -1
36 echo "Failed static checks, continuing with build."
37 }
Dean Birch62c4f082020-01-17 16:13:26 +000038}
39stage("Trigger Build") {
40 parallel(["build":trigger("tf-m-build-and-test")])
Karl Zhangaa6dd152020-06-09 17:28:34 +080041 // If previously failed at static checks, ignore the failure at this moment
42 // The cpp check and check patch may fail for current checking policy, or
43 // fail by the TF-M coding not align with Linux style completely.
Matthew Hartfb6fd362020-03-04 21:03:59 +000044 if (status < 0 ) {
Karl Zhangaa6dd152020-06-09 17:28:34 +080045 echo "Ignore the static checks failure."
Matthew Hartfb6fd362020-03-04 21:03:59 +000046 }
Dean Birch62c4f082020-01-17 16:13:26 +000047}