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 | |
Dean Birch | d0f9f8c | 2020-03-26 11:10:33 +0000 | [diff] [blame] | 9 | @Library('trustedfirmware') _ |
| 10 | import org.trustedfirmware.Gerrit |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 11 | |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame] | 12 | timestamps { |
| 13 | node("docker-amd64-tf-m-bionic") { |
Leonardo Sandoval | 7090b2c | 2021-09-17 13:20:44 -0500 | [diff] [blame] | 14 | // Clone TF-M repositories so share folder can be reused by downstream jobs |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame] | 15 | stage("Init") { |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 16 | cleanWs() |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame] | 17 | dir("tf-m-ci-scripts") { |
| 18 | checkout([$class: 'GitSCM', branches: [[name: '$CI_SCRIPTS_BRANCH']], userRemoteConfigs: [[credentialsId: 'GIT_SSH_KEY', url: '$CI_SCRIPTS_REPO']]]) |
Leonardo Sandoval | 7090b2c | 2021-09-17 13:20:44 -0500 | [diff] [blame] | 19 | sh "./clone.sh" |
Xinyu Zhang | 4cdfd1b | 2021-05-21 15:10:49 +0800 | [diff] [blame] | 20 | } |
| 21 | } |
| 22 | stage("Check") { |
| 23 | def verify = 1 |
| 24 | try { |
| 25 | sh """ |
| 26 | cd trusted-firmware-m |
| 27 | export GIT_REF_ARG="" |
| 28 | if [ ! -z "\$GERRIT_PATCHSET_REVISION" ] ; then |
| 29 | export GIT_REF_ARG="HEAD" |
| 30 | fi |
| 31 | ../tf-m-ci-scripts/run-cppcheck.sh -r \$GIT_REF_ARG |
| 32 | """ |
| 33 | } catch (Exception e) { |
| 34 | manager.buildFailure() |
| 35 | verify = -1 |
| 36 | } finally { |
| 37 | g = new Gerrit() |
| 38 | g.verifyStatusInWorkspace(verify, 'cppcheck', 'static') |
| 39 | def buildStatus = (verify == 1) ? 'Successful' : 'Failed' |
| 40 | //g.commentInWorkspace("Build cppcheck ${buildStatus}: ${env.RUN_DISPLAY_URL}") |
| 41 | cleanWs() |
| 42 | } |
Dean Birch | 62c4f08 | 2020-01-17 16:13:26 +0000 | [diff] [blame] | 43 | } |
| 44 | } |
| 45 | } |