blob: cb76ebb222cc39436acee789f1711db87e1f183d [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
Dean Birchd0f9f8c2020-03-26 11:10:33 +00009@Library('trustedfirmware') _
10import org.trustedfirmware.Gerrit
Dean Birch62c4f082020-01-17 16:13:26 +000011
Karl Zhangfec84102020-06-24 09:56:36 +080012node("docker-amd64-bionic") {
Dean Birch62c4f082020-01-17 16:13:26 +000013 stage("Init") {
14 cleanWs()
15 dir("trusted-firmware-m") {
16 checkout(
17 poll: false,
18 scm: [
19 $class: 'GitSCM',
20 branches: [[name: '$GERRIT_BRANCH']],
21 extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
22 userRemoteConfigs: [[
23 credentialsId: 'GIT_SSH_KEY',
24 refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
25 ]]
26 ])
27 }
28 dir("tf-m-ci-scripts") {
Matthew Hartfb6fd362020-03-04 21:03:59 +000029 git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
Dean Birch62c4f082020-01-17 16:13:26 +000030 }
31 dir("mbed-crypto") {
32 checkout(
33 changelog: false,
34 poll: false,
35 scm: [
36 $class: 'GitSCM',
Dean Birch7249bfa2020-05-21 16:22:39 +010037 branches: [[name: 'FETCH_HEAD']],
Dean Birch62c4f082020-01-17 16:13:26 +000038 userRemoteConfigs: [[
39 refspec: 'refs/tags/$MBEDCRYPTO_VERSION',
Dean Bircha6ede7e2020-03-13 14:00:33 +000040 url: params.MBEDCRYPTO_URL
Dean Birch62c4f082020-01-17 16:13:26 +000041 ]]
42 ]
43 )
44 }
Karl Zhang02d30352020-08-20 13:48:52 +080045 dir("mbedtls") {
46 checkout(
47 changelog: false,
48 poll: false,
49 scm: [
50 $class: 'GitSCM',
51 branches: [[name: 'FETCH_HEAD']],
52 userRemoteConfigs: [[
53 refspec: 'refs/tags/$MBEDTLS_VERSION',
54 url: params.MBEDTLS_URL
55 ]]
56 ]
57 )
58 }
Tamas Banf123c6e2020-06-19 11:44:03 +010059 dir("mcuboot") {
60 checkout(
61 changelog: false,
62 poll: false,
63 scm: [
64 $class: 'GitSCM',
65 branches: [[name: 'FETCH_HEAD']],
66 userRemoteConfigs: [[
67 refspec: 'refs/tags/$MCUBOOT_VERSION',
68 url: params.MCUBOOT_URL
69 ]]
70 ]
71 )
72 }
Kevin Peng61a94a32020-06-22 10:58:59 +080073 dir("tf-m-tests") {
74 checkout(
75 changelog: false,
76 poll: false,
77 scm: [
78 $class: 'GitSCM',
79 branches: [[name: 'FETCH_HEAD']],
80 userRemoteConfigs: [[
81 refspec: '$TFM_TESTS_REFSPEC',
82 url: params.TFM_TESTS_URL
83 ]]
84 ]
85 )
86 }
Dean Birch62c4f082020-01-17 16:13:26 +000087 }
88 stage("Check") {
89 def verify = 1
90 try {
91 sh """
92cd trusted-firmware-m
93export GIT_REF_ARG=""
94if [ ! -z "\$GERRIT_PATCHSET_REVISION" ] ; then
95 export GIT_REF_ARG="HEAD"
96fi
97../tf-m-ci-scripts/run-cppcheck.sh -r \$GIT_REF_ARG
98"""
99 } catch (Exception e) {
100 manager.buildFailure()
101 verify = -1
102 } finally {
Dean Birchd0f9f8c2020-03-26 11:10:33 +0000103 g = new Gerrit()
104 g.verifyStatusInWorkspace(verify, 'cppcheck', 'static')
Matthew Hartfb6fd362020-03-04 21:03:59 +0000105 def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
106 //g.commentInWorkspace("Build cppcheck ${buildStatus}: ${env.RUN_DISPLAY_URL}")
Dean Birch62c4f082020-01-17 16:13:26 +0000107 cleanWs()
108 }
109 }
110}