blob: 1aad8bd62d1fd15892a77b414a1dbe49ced5d570 [file] [log] [blame]
#!/usr/bin/env groovy
//-------------------------------------------------------------------------------
// Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//
//-------------------------------------------------------------------------------
@Library('trustedfirmware') _
import org.trustedfirmware.Gerrit
node("docker-amd64-bionic") {
stage("Init") {
cleanWs()
dir("trusted-firmware-m") {
checkout(
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: '$GERRIT_BRANCH']],
extensions: [[$class: 'BuildChooserSetting', buildChooser: [$class: 'GerritTriggerBuildChooser']]],
userRemoteConfigs: [[
credentialsId: 'GIT_SSH_KEY',
refspec: '$GERRIT_REFSPEC', url: '$CODE_REPO'
]]
])
}
dir("tf-m-ci-scripts") {
git url: '$CI_SCRIPTS_REPO', branch: '$CI_SCRIPTS_BRANCH', credentialsId: 'GIT_SSH_KEY'
}
dir("mbed-crypto") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: 'refs/tags/$MBEDCRYPTO_VERSION',
url: params.MBEDCRYPTO_URL
]]
]
)
}
dir("mcuboot") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: 'refs/tags/$MCUBOOT_VERSION',
url: params.MCUBOOT_URL
]]
]
)
}
dir("tf-m-tests") {
checkout(
changelog: false,
poll: false,
scm: [
$class: 'GitSCM',
branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[
refspec: '$TFM_TESTS_REFSPEC',
url: params.TFM_TESTS_URL
]]
]
)
}
sh """
# Host https://github.com/Arm-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack
# under \$JENKINS_HOME/userContent
set +e
wget -O cmsis.pack -q \${JENKINS_URL}/userContent/ARM.CMSIS.${CMSIS_VERSION}.pack
if [ "\$?" != "0" ] ; then
set -e
wget -O cmsis.pack -q https://github.com/Arm-software/CMSIS_5/releases/download/${CMSIS_VERSION}/ARM.CMSIS.${CMSIS_VERSION}.pack
fi
set -e
unzip -o -d CMSIS_5 cmsis.pack
"""
}
stage("Check") {
def verify = 1
try {
sh """
cd trusted-firmware-m
export GIT_REF_ARG=""
if [ ! -z "\$GERRIT_PATCHSET_REVISION" ] ; then
export GIT_REF_ARG="HEAD"
fi
../tf-m-ci-scripts/run-cppcheck.sh -r \$GIT_REF_ARG
"""
} catch (Exception e) {
manager.buildFailure()
verify = -1
} finally {
g = new Gerrit()
g.verifyStatusInWorkspace(verify, 'cppcheck', 'static')
def buildStatus = (verify == 1) ? 'Successful' : 'Failed'
//g.commentInWorkspace("Build cppcheck ${buildStatus}: ${env.RUN_DISPLAY_URL}")
cleanWs()
}
}
}