blob: 95537a31f1c70f8cee698ce8305428300f10f9e7 [file] [log] [blame]
Dean Birch62c4f082020-01-17 16:13:26 +00001#!/usr/bin/env groovy
2//-------------------------------------------------------------------------------
Xinyu Zhang386b4f82021-01-22 17:12:37 +08003// Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
Dean Birch62c4f082020-01-17 16:13:26 +00004//
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 ?: '')
Karl Zhang02d30352020-08-20 13:48:52 +080018 params += string(name: 'MBEDTLS_VERSION', value: env.MBEDTLS_VERSION)
Dean Birch62c4f082020-01-17 16:13:26 +000019 params += string(name: 'CODE_REPO', value: env.CODE_REPO)
20 build(job: job_name, parameters: params)
21 }
22}
23
Matthew Hartfb6fd362020-03-04 21:03:59 +000024def status = 1
25
Dean Birch62c4f082020-01-17 16:13:26 +000026stage("Static Checks") {
27 def checks = [:]
28 checks["cppcheck"] = trigger("tf-m-cppcheck")
29 checks["checkpatch"] = trigger("tf-m-checkpatch")
Leonardo Sandoval2d207d02020-08-05 13:54:52 -050030 checks["static-checks"] = trigger("tf-m-static-checks")
Matthew Hartfb6fd362020-03-04 21:03:59 +000031 try {
32 parallel(checks)
33 } catch (Exception e) {
34 status = -1
35 echo "Failed static checks, continuing with build."
36 }
Dean Birch62c4f082020-01-17 16:13:26 +000037}
38stage("Trigger Build") {
39 parallel(["build":trigger("tf-m-build-and-test")])
Xinyu Zhang386b4f82021-01-22 17:12:37 +080040 // If previously failed at static checks, mark this as a failure
Matthew Hartfb6fd362020-03-04 21:03:59 +000041 if (status < 0 ) {
Xinyu Zhang386b4f82021-01-22 17:12:37 +080042 error("Failing due to failed static checks.")
Matthew Hartfb6fd362020-03-04 21:03:59 +000043 }
Dean Birch62c4f082020-01-17 16:13:26 +000044}