blob: fb40a9f4954bef4c0b5419b790d15e9a3ce1d995 [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
12node("docker-amd64-xenial") {
13 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") {
29 git url: '$CI_SCRIPTS_REPO', branch: 'master', credentialsId: 'GIT_SSH_KEY'
30 }
31 dir("mbed-crypto") {
32 checkout(
33 changelog: false,
34 poll: false,
35 scm: [
36 $class: 'GitSCM',
37 branches: [[name: 'FETCH_HEAD']],
38 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 }
45 sh """
Dean Bircha6ede7e2020-03-13 14:00:33 +000046# Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
47# under \$JENKINS_HOME/userContent
48wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
Dean Birch62c4f082020-01-17 16:13:26 +000049unzip -o -d CMSIS_5 cmsis.pack
50"""
51 }
52 stage("Check") {
53 def verify = 1
54 try {
55 sh """
56cd trusted-firmware-m
57export GIT_REF_ARG=""
58if [ ! -z "\$GERRIT_PATCHSET_REVISION" ] ; then
59 export GIT_REF_ARG="HEAD"
60fi
61../tf-m-ci-scripts/run-cppcheck.sh -r \$GIT_REF_ARG
62"""
63 } catch (Exception e) {
64 manager.buildFailure()
65 verify = -1
66 } finally {
Dean Birchd0f9f8c2020-03-26 11:10:33 +000067 g = new Gerrit()
68 g.verifyStatusInWorkspace(verify, 'cppcheck', 'static')
Dean Birch62c4f082020-01-17 16:13:26 +000069 cleanWs()
70 }
71 }
72}