Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 1 | #!/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 | |
| 10 | def 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) |
| 20 | params += string(name: 'CODE_REPO', value: env.CODE_REPO) |
| 21 | build(job: job_name, parameters: params) |
| 22 | } |
| 23 | } |
| 24 | |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame^] | 25 | def status = 1 |
| 26 | |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 27 | stage("Static Checks") { |
| 28 | def checks = [:] |
| 29 | checks["cppcheck"] = trigger("tf-m-cppcheck") |
| 30 | checks["checkpatch"] = trigger("tf-m-checkpatch") |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame^] | 31 | try { |
| 32 | parallel(checks) |
| 33 | } catch (Exception e) { |
| 34 | status = -1 |
| 35 | echo "Failed static checks, continuing with build." |
| 36 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 37 | } |
| 38 | stage("Trigger Build") { |
| 39 | parallel(["build":trigger("tf-m-build-and-test")]) |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame^] | 40 | // If previously failed at static checks, mark this as a failure |
| 41 | if (status < 0 ) { |
| 42 | error("Failing due to failed static checks.") |
| 43 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 44 | } |